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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CAREamics_careamics | TwoChannelData | public | 0 | 1 | __init__ | def __init__(self,preloaded_data: NDArray,data_config: MicroSplitDataConfig,fpath: str,load_data_fn: Callable,val_fraction=None,test_fraction=None,):self._preloaded_data = preloaded_datasuper().__init__(data_config,fpath,load_data_fn=load_data_fn,val_fraction=val_fraction,test_fraction=test_fraction,) | 1 | 17 | 7 | 58 | 0 | 124 | 140 | 82 | self,data_arr1,data_arr2,paths_data1,paths_data2 | [] | None | {"Assign": 3, "Expr": 1, "For": 1} | 7 | 16 | 7 | ["len", "len", "range", "len", "len", "self._data.append", "np.concatenate"] | 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 TwoChannelData, that inherit another class.The function start at line 124 and ends at 140. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [82.0] and does not return any value. It declares 7.0 func... |
CAREamics_careamics | SingleFileLCDset | public | 0 | 1 | rm_bkground_set_max_val_and_upperclip_data | def rm_bkground_set_max_val_and_upperclip_data(self, max_val, datasplit_type):pass | 1 | 2 | 3 | 10 | 0 | 142 | 143 | 104 | self,max_val,datasplit_type | [] | None | {} | 0 | 2 | 0 | [] | 0 | [] | The function (rm_bkground_set_max_val_and_upperclip_data) defined within the public class called SingleFileLCDset, that inherit another class.The function start at line 142 and ends at 143. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [104.0] and does not re... |
CAREamics_careamics | SingleFileLCDset | public | 0 | 1 | data_path | def data_path(self):return self._fpath | 1 | 2 | 1 | 9 | 0 | 146 | 147 | 101 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (data_path) defined within the public class called SingleFileLCDset, that inherit another class.The function start at line 146 and ends at 147. 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.. |
CAREamics_careamics | SingleFileLCDset | public | 0 | 1 | load_data | def load_data(self,data_config: MicroSplitDataConfig,datasplit_type: DataSplitType,load_data_fn: Callable[..., NDArray],val_fraction=None,test_fraction=None,allow_generation=None,):self._data = self._preloaded_dataassert ("channel_1" not in data_config), "Outdated config file. Please remove channel_1, channel_2, channe... | 1 | 20 | 7 | 75 | 0 | 149 | 168 | 149 | self,data_config,datasplit_type,load_data_fn,val_fraction,test_fraction,allow_generation | [] | None | {"Assign": 1, "Expr": 1} | 4 | 14 | 4 | ["isinstance", "isinstance", "isinstance", "self._loaded_data_preprocessing"] | 12 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3919742_opendatacube_datacube_stats.datacube_stats.main_py.load_process_save_chunk", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3959435_kscsdk_ksc_sdk_python.kscore.session_py.Session.get_data", "_.content.gdrive... | The function (load_data) defined within the public class called SingleFileLCDset, that inherit another class.The function start at line 149 and ends at 168. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [149.0] and does not return any value. It declares 4.0 ... |
CAREamics_careamics | TwoChannelData | public | 0 | 1 | __init__ | def __init__(self,data_config: MicroSplitDataConfig,fpath: str,load_data_fn: Callable[..., Union[TwoChannelData, MultiChannelData]],val_fraction=None,test_fraction=None,):self._fpath = fpathdata: Union[TwoChannelData, MultiChannelData] = load_data_fn(data_config,self._fpath,data_config.datasplit_type,val_fraction=val_f... | 5 | 60 | 6 | 256 | 0 | 176 | 240 | 176 | self,data_arr1,data_arr2,paths_data1,paths_data2 | [] | None | {"Assign": 3, "Expr": 1, "For": 1} | 7 | 16 | 7 | ["len", "len", "range", "len", "len", "self._data.append", "np.concatenate"] | 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 TwoChannelData, that inherit another class.The function start at line 176 and ends at 240. It contains 60 lines of code and it has a cyclomatic complexity of 5. It takes 6 parameters, represented as [176.0] and does not return any value. It declares 7.0 fun... |
CAREamics_careamics | SingleFileLCDset | public | 0 | 1 | rm_bkground_set_max_val_and_upperclip_data | def rm_bkground_set_max_val_and_upperclip_data(self, max_val, datasplit_type):self.set_max_val(max_val, datasplit_type)self.upperclip_data() | 1 | 3 | 3 | 22 | 0 | 242 | 244 | 242 | self,max_val,datasplit_type | [] | None | {} | 0 | 2 | 0 | [] | 0 | [] | The function (rm_bkground_set_max_val_and_upperclip_data) defined within the public class called SingleFileLCDset, that inherit another class.The function start at line 242 and ends at 244. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [242.0] and does not re... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | set_mean_std | def set_mean_std(self, mean_val, std_val):for dset in self.dsets:dset.set_mean_std(mean_val, std_val) | 2 | 3 | 3 | 24 | 0 | 246 | 248 | 246 | self,mean_val,std_val | [] | None | {"Expr": 1, "For": 1} | 1 | 3 | 1 | ["dset.set_mean_std"] | 0 | [] | The function (set_mean_std) defined within the public class called MultiFileDset.The function start at line 246 and ends at 248. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [246.0] and does not return any value. It declare 1.0 function, and It has 1.0 func... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | get_mean_std | def get_mean_std(self):return self.dsets[0].get_mean_std() | 1 | 2 | 1 | 16 | 0 | 250 | 251 | 250 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["get_mean_std"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.multifile_dataset_py.MultiFileDset.get_mean_std"] | The function (get_mean_std) defined within the public class called MultiFileDset.The function start at line 250 and ends at 251. 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 ... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | compute_max_val | def compute_max_val(self):max_val_arr = []for dset in self.dsets:max_val_arr.append(dset.compute_max_val())return np.max(max_val_arr) | 2 | 5 | 1 | 33 | 0 | 253 | 257 | 253 | self | [] | Returns | {"Assign": 1, "Expr": 1, "For": 1, "Return": 1} | 3 | 5 | 3 | ["max_val_arr.append", "dset.compute_max_val", "np.max"] | 0 | [] | The function (compute_max_val) defined within the public class called MultiFileDset.The function start at line 253 and ends at 257. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | set_max_val | def set_max_val(self, max_val, datasplit_type):if datasplit_type == DataSplitType.Train:assert max_val is Nonemax_val = self.compute_max_val()for dset in self.dsets:dset.set_max_val(max_val, datasplit_type) | 3 | 6 | 3 | 42 | 0 | 259 | 264 | 259 | self,max_val,datasplit_type | [] | None | {"Assign": 1, "Expr": 1, "For": 1, "If": 1} | 2 | 6 | 2 | ["self.compute_max_val", "dset.set_max_val"] | 0 | [] | The function (set_max_val) defined within the public class called MultiFileDset.The function start at line 259 and ends at 264. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [259.0] and does not return any value. It declares 2.0 functions, and It has 2.0 fun... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | upperclip_data | def upperclip_data(self):for dset in self.dsets:dset.upperclip_data() | 2 | 3 | 1 | 17 | 0 | 266 | 268 | 266 | self | [] | None | {"Expr": 1, "For": 1} | 1 | 3 | 1 | ["dset.upperclip_data"] | 0 | [] | The function (upperclip_data) defined within the public class called MultiFileDset.The function start at line 266 and ends at 268. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 functi... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | get_max_val | def get_max_val(self):return self.dsets[0].get_max_val() | 1 | 2 | 1 | 16 | 0 | 270 | 271 | 270 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["get_max_val"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.multifile_dataset_py.MultiFileDset.get_max_val"] | The function (get_max_val) defined within the public class called MultiFileDset.The function start at line 270 and ends at 271. 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 c... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | get_img_sz | def get_img_sz(self):return self.dsets[0].get_img_sz() | 1 | 2 | 1 | 16 | 0 | 273 | 274 | 273 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["get_img_sz"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.multifile_dataset_py.MultiFileDset.get_img_sz"] | The function (get_img_sz) defined within the public class called MultiFileDset.The function start at line 273 and ends at 274. 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 ca... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | set_img_sz | def set_img_sz(self, image_size, grid_size):for dset in self.dsets:dset.set_img_sz(image_size, grid_size) | 2 | 3 | 3 | 24 | 0 | 276 | 278 | 276 | self,image_size,grid_size | [] | None | {"Expr": 1, "For": 1} | 1 | 3 | 1 | ["dset.set_img_sz"] | 0 | [] | The function (set_img_sz) defined within the public class called MultiFileDset.The function start at line 276 and ends at 278. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [276.0] and does not return any value. It declare 1.0 function, and It has 1.0 functi... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | compute_mean_std | def compute_mean_std(self):cur_mean = {"target": 0, "input": 0}cur_std = {"target": 0, "input": 0}for dset in self.dsets:mean, std = dset.compute_mean_std()cur_mean["target"] += mean["target"]cur_mean["input"] += mean["input"]cur_std["target"] += std["target"]cur_std["input"] += std["input"]cur_mean["target"] /= len(se... | 2 | 14 | 1 | 131 | 0 | 280 | 295 | 280 | self | [] | Returns | {"Assign": 3, "AugAssign": 8, "For": 1, "Return": 1} | 5 | 16 | 5 | ["dset.compute_mean_std", "len", "len", "len", "len"] | 0 | [] | The function (compute_mean_std) defined within the public class called MultiFileDset.The function start at line 280 and ends at 295. It contains 14 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 5.0 functions, and It has 5... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | compute_individual_mean_std | def compute_individual_mean_std(self):cum_mean = 0cum_std = 0for dset in self.dsets:mean, std = dset.compute_individual_mean_std()cum_mean += meancum_std += stdreturn cum_mean / len(self.dsets), cum_std / len(self.dsets) | 2 | 8 | 1 | 51 | 0 | 297 | 304 | 297 | self | [] | Returns | {"Assign": 3, "AugAssign": 2, "For": 1, "Return": 1} | 3 | 8 | 3 | ["dset.compute_individual_mean_std", "len", "len"] | 0 | [] | The function (compute_individual_mean_std) defined within the public class called MultiFileDset.The function start at line 297 and ends at 304. 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 3.0 functions, and... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | get_num_frames | def get_num_frames(self):return len(self.dsets) | 1 | 2 | 1 | 12 | 0 | 306 | 307 | 306 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["len"] | 0 | [] | The function (get_num_frames) defined within the public class called MultiFileDset.The function start at line 306 and ends at 307. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, and It has 1.0 fu... |
CAREamics_careamics | MultiFileDset | public | 0 | 0 | reduce_data | def reduce_data(self, t_list=None, h_start=None, h_end=None, w_start=None, w_end=None):assert h_start is Noneassert h_end is Noneassert w_start is Noneassert w_end is Noneself.dsets = [self.dsets[t] for t in t_list]print(f"[{self.__class__.__name__}] Data reduced. New data count: {len(self.dsets)}") | 2 | 11 | 6 | 62 | 0 | 309 | 319 | 309 | self,t_list,h_start,h_end,w_start,w_end | [] | None | {"Assign": 1, "Expr": 1} | 2 | 11 | 2 | ["print", "len"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.78400723_sagemath_sagetrac_mirror.src.sage.rings.finite_rings.finite_field_pari_ffelt_py.FiniteField_pari_ffelt.__reduce__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.78400723_sagemath_sagetrac_mirror.src.sage.r... | The function (reduce_data) defined within the public class called MultiFileDset.The function start at line 309 and ends at 319. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [309.0] and does not return any value. It declares 2.0 functions, It has 2.0 functio... |
CAREamics_careamics | TwoChannelData | public | 0 | 1 | __len__ | def __len__(self):out = 0for dset in self.dsets:out += len(dset)return out | 2 | 5 | 1 | 23 | 0 | 321 | 325 | 321 | self | [] | Returns | {"Assign": 1, "AugAssign": 1, "For": 1, "Return": 1} | 0 | 5 | 0 | [] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3576232_vmware_liota.packages.examples.kura.kura_integrate_iotcc_py.sub_callback", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3665918_alvinwan_neural_backed_decision_trees.nbdt.data.imagenet_py._TinyImagenet200Va... | The function (__len__) defined within the public class called TwoChannelData, that inherit another class.The function start at line 321 and ends at 325. It contains 5 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 3.0 functions ... |
CAREamics_careamics | TwoChannelData | public | 0 | 1 | __getitem__ | def __getitem__(self, idx):cum_len = 0for dset in self.dsets:cum_len += len(dset)if idx < cum_len:rel_idx = idx - (cum_len - len(dset))return dset[rel_idx]raise IndexError("Index out of range") | 3 | 8 | 2 | 50 | 0 | 327 | 335 | 327 | self,idx | [] | Returns | {"Assign": 1, "AugAssign": 1, "For": 1, "If": 2, "Return": 2} | 2 | 10 | 2 | ["enumerate", "IndexError"] | 30 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3535398_idsia_brainstorm.brainstorm.structure.buffer_views_py.BufferView.__getitem__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.feed_py.Lists.__getitem__", "_.content.gdriv... | The function (__getitem__) defined within the public class called TwoChannelData, that inherit another class.The function start at line 327 and ends at 335. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [327.0], and this function return a value. It declares 2... |
CAREamics_careamics | public | public | 0 | 0 | load_tiff | def load_tiff(path):"""Returns a 4d numpy array: num_imgs*h*w*num_channels"""data = imread(path, plugin="tifffile")return data | 1 | 3 | 1 | 18 | 1 | 11 | 16 | 11 | path | ['data'] | Returns | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 6 | 1 | ["imread"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.utils.data_utils_py.load_tiffs"] | The function (load_tiff) defined within the public class called public.The function start at line 11 and ends at 16. 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 declare 1.0 function, It has 1.0 function called insid... |
CAREamics_careamics | public | public | 0 | 0 | save_tiff | def save_tiff(path, data):imsave(path, data, plugin="tifffile") | 1 | 2 | 2 | 17 | 0 | 19 | 20 | 19 | path,data | [] | None | {"Expr": 1} | 1 | 2 | 1 | ["imsave"] | 0 | [] | The function (save_tiff) defined within the public class called public.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 2 parameters, represented as [19.0] and does not return any value. It declare 1.0 function, and It has 1.0 function called i... |
CAREamics_careamics | public | public | 0 | 0 | load_tiffs | def load_tiffs(paths):data = [load_tiff(path) for path in paths]return np.concatenate(data, axis=0) | 2 | 3 | 1 | 28 | 1 | 23 | 25 | 23 | paths | ['data'] | Returns | {"Assign": 1, "Return": 1} | 2 | 3 | 2 | ["load_tiff", "np.concatenate"] | 0 | [] | The function (load_tiffs) defined within the public class called public.The function start at line 23 and ends at 25. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and It has 2.0 functions cal... |
CAREamics_careamics | public | public | 0 | 0 | split_in_half | def split_in_half(s, e):n = e - ss1 = list(np.arange(n // 2))s2 = list(np.arange(n // 2, n))return [x + s for x in s1], [x + s for x in s2] | 3 | 5 | 2 | 52 | 3 | 28 | 32 | 28 | s,e | ['n', 's2', 's1'] | Returns | {"Assign": 3, "Return": 1} | 4 | 5 | 4 | ["list", "np.arange", "list", "np.arange"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.utils.data_utils_py.get_datasplit_tuples"] | The function (split_in_half) defined within the public class called public.The function start at line 28 and ends at 32. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [28.0], and this function return a value. It declares 4.0 functions, It has 4.0 functions ca... |
CAREamics_careamics | public | public | 0 | 0 | adjust_for_imbalance_in_fraction_value | def adjust_for_imbalance_in_fraction_value(val: List[int],test: List[int],val_fraction: float,test_fraction: float,total_size: int,):"""here, val and test are divided almost equally. Here, we need to take into account their respective fractionsand pick elements rendomly from one array and put in the other array."""if v... | 5 | 26 | 5 | 167 | 4 | 35 | 64 | 35 | val,test,val_fraction,test_fraction,total_size | ['val', 'diff_fraction', 'test', 'imb_count'] | Returns | {"Assign": 9, "AugAssign": 4, "Expr": 1, "If": 4, "Return": 1} | 8 | 30 | 8 | ["int", "list", "permutation", "np.random.RandomState", "int", "list", "permutation", "np.random.RandomState"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.utils.data_utils_py.get_datasplit_tuples"] | The function (adjust_for_imbalance_in_fraction_value) defined within the public class called public.The function start at line 35 and ends at 64. It contains 26 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [35.0], and this function return a value. It declares 8.0 function... |
CAREamics_careamics | public | public | 0 | 0 | get_datasplit_tuples | def get_datasplit_tuples(val_fraction: float,test_fraction: float,total_size: int,starting_test: bool = False,):if starting_test:# test => val => traintest = list(range(0, int(total_size * test_fraction)))val = list(range(test[-1] + 1, test[-1] + 1 + int(total_size * val_fraction)))train = list(range(val[-1] + 1, total... | 6 | 38 | 4 | 269 | 7 | 67 | 114 | 67 | val_fraction,test_fraction,total_size,starting_test | ['test_val_size', 'test', 'nchunks', 'chunksize', 'train', 's', 'val'] | Returns | {"Assign": 14, "AugAssign": 6, "For": 1, "If": 4, "Return": 2} | 22 | 48 | 22 | ["list", "range", "int", "list", "range", "int", "list", "range", "int", "list", "range", "max", "min", "range", "list", "np.arange", "list", "np.arange", "list", "np.arange", "split_in_half", "adjust_for_imbalance_in_fraction_value"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.microsplit_data_module_py.get_train_val_data"] | The function (get_datasplit_tuples) defined within the public class called public.The function start at line 67 and ends at 114. It contains 38 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [67.0], and this function return a value. It declares 22.0 functions, It has 22.0 f... |
CAREamics_careamics | EmptyPatchFetcher | public | 0 | 0 | __init__ | def __init__(self, idx_manager, patch_size, data_frames, max_val_threshold=None):self._frames = data_framesself._idx_manager = idx_managerself._max_val_threshold = max_val_thresholdself._idx_list = []self._patch_size = patch_sizeself._grid_size = 1self.set_empty_idx()print(f"[{self.__class__.__name__}] MaxVal:{self._ma... | 1 | 9 | 5 | 56 | 0 | 10 | 19 | 10 | self,idx_manager,patch_size,data_frames,max_val_threshold | [] | None | {"Assign": 6, "Expr": 2} | 2 | 10 | 2 | ["self.set_empty_idx", "print"] | 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 EmptyPatchFetcher.The function start at line 10 and ends at 19. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [10.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions ... |
CAREamics_careamics | EmptyPatchFetcher | public | 0 | 0 | compute_max | def compute_max(self, window):"""Rolling compute."""N, H, W = self._frames.shaperandnum = -954321assert self._grid_size == 1max_data = np.zeros((N, H - window, W - window)) * randnumfor h in tqdm(range(H - window)):for w in range(W - window):max_data[:, h, w] = self._frames[:, h : h + window, w : w + window].max(axis=(... | 3 | 12 | 2 | 122 | 0 | 21 | 37 | 21 | self,window | [] | Returns | {"Assign": 4, "Expr": 1, "For": 2, "Return": 1} | 6 | 17 | 6 | ["np.zeros", "tqdm", "range", "range", "max", "any"] | 0 | [] | The function (compute_max) defined within the public class called EmptyPatchFetcher.The function start at line 21 and ends at 37. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [21.0], and this function return a value. It declares 6.0 functions, and It has 6... |
CAREamics_careamics | EmptyPatchFetcher | public | 0 | 0 | set_empty_idx | def set_empty_idx(self):max_data = self.compute_max(self._patch_size)empty_loc = np.where(np.logical_and(max_data >= 0, max_data < self._max_val_threshold))# print(max_data.shape, len(empty_loc))self._idx_list = []for idx in range(len(empty_loc[0])):n_idx = empty_loc[0][idx]h_start = empty_loc[1][idx]w_start = empty_lo... | 2 | 19 | 1 | 170 | 0 | 39 | 62 | 39 | self | [] | None | {"Assign": 10, "Expr": 1, "For": 1} | 10 | 24 | 10 | ["self.compute_max", "np.where", "np.logical_and", "range", "len", "self._idx_manager.get_dataset_idx_from_location", "self._idx_manager.get_location_from_dataset_idx", "self._idx_list.append", "np.array", "len"] | 0 | [] | The function (set_empty_idx) defined within the public class called EmptyPatchFetcher.The function start at line 39 and ends at 62. It contains 19 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 10.0 functions, and It has 10.0 ... |
CAREamics_careamics | EmptyPatchFetcher | public | 0 | 0 | sample | def sample(self):return (np.random.choice(self._idx_list), self._grid_size) | 1 | 2 | 1 | 22 | 0 | 64 | 65 | 64 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["np.random.choice"] | 67 | ["_.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.3660028_openprocurement_openprocurement_auction.openprocurement.auction.helpers.couch_... | The function (sample) defined within the public class called EmptyPatchFetcher.The function start at line 64 and ends at 65. 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 call... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | __post_init__ | def __post_init__(self):assert len(self.data_shape) == len(self.grid_shape), f"Data shape:{self.data_shape} and grid size:{self.grid_shape} must have the same dimension"assert len(self.data_shape) == len(self.patch_shape), f"Data shape:{self.data_shape} and patch shape:{self.patch_shape} must have the same dimension"in... | 4 | 17 | 1 | 92 | 0 | 20 | 36 | 20 | self | [] | None | {"Assign": 1, "For": 1, "If": 2} | 9 | 17 | 9 | ["len", "len", "len", "len", "np.array", "np.array", "enumerate", "ValueError", "ValueError"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953269_alisaifee_flask_limiter.flask_limiter._limits_py.RouteLimit.__post_init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.88805393_amisadmin_fastapi_amis_admin.fastapi_amis_admin.admin.extensions.schemas_py.... | The function (__post_init__) defined within the public class called GridIndexManager.The function start at line 20 and ends at 36. It contains 17 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 9.0 functions, It has 9.0 function... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | patch_offset | def patch_offset(self):return (np.array(self.patch_shape) - np.array(self.grid_shape)) // 2 | 1 | 2 | 1 | 26 | 0 | 38 | 39 | 38 | self | [] | Returns | {"Return": 1} | 2 | 2 | 2 | ["np.array", "np.array"] | 0 | [] | The function (patch_offset) defined within the public class called GridIndexManager.The function start at line 38 and ends at 39. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and It has 2.0 f... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_individual_dim_grid_count | def get_individual_dim_grid_count(self, dim: int):"""Returns the number of the grid in the specified dimension, ignoring all other dimensions."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"if self.g... | 5 | 19 | 2 | 178 | 0 | 41 | 63 | 41 | self,dim | [] | Returns | {"Assign": 2, "Expr": 1, "If": 3, "Return": 4} | 7 | 23 | 7 | ["len", "int", "np.ceil", "int", "np.ceil", "int", "np.floor"] | 0 | [] | The function (get_individual_dim_grid_count) defined within the public class called GridIndexManager.The function start at line 41 and ends at 63. It contains 19 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [41.0], and this function return a value. It declares 7.0 functio... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | total_grid_count | def total_grid_count(self):"""Returns the total number of grids in the dataset."""return self.grid_count(0) * self.get_individual_dim_grid_count(0) | 1 | 2 | 1 | 20 | 0 | 65 | 69 | 65 | self | [] | Returns | {"Expr": 1, "Return": 1} | 2 | 5 | 2 | ["self.grid_count", "self.get_individual_dim_grid_count"] | 0 | [] | The function (total_grid_count) defined within the public class called GridIndexManager.The function start at line 65 and ends at 69. 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 has 2... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | grid_count | def grid_count(self, dim: int):"""Returns the total number of grids for one value in the specified dimension."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"if dim == len(self.data_shape) - 1:return ... | 2 | 8 | 2 | 60 | 0 | 71 | 82 | 71 | self,dim | [] | Returns | {"Expr": 1, "If": 1, "Return": 2} | 4 | 12 | 4 | ["len", "len", "self.get_individual_dim_grid_count", "self.grid_count"] | 0 | [] | The function (grid_count) defined within the public class called GridIndexManager.The function start at line 71 and ends at 82. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [71.0], and this function return a value. It declares 4.0 functions, and It has 4.0 ... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_grid_index | def get_grid_index(self, dim: int, coordinate: int):"""Returns the index of the grid in the specified dimension."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"assert (coordinate < self.data_shape[di... | 7 | 25 | 3 | 228 | 0 | 84 | 115 | 84 | self,dim,coordinate | [] | Returns | {"Assign": 2, "Expr": 1, "If": 5, "Return": 5} | 8 | 32 | 8 | ["len", "np.floor", "max", "np.floor", "self.get_individual_dim_grid_count", "max", "np.floor", "ValueError"] | 0 | [] | The function (get_grid_index) defined within the public class called GridIndexManager.The function start at line 84 and ends at 115. It contains 25 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [84.0], and this function return a value. It declares 8.0 functions, and It ha... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | dataset_idx_from_grid_idx | def dataset_idx_from_grid_idx(self, grid_idx: tuple):"""Returns the index of the grid in the dataset."""assert len(grid_idx) == len(self.data_shape), f"Dimension indices {grid_idx} must have the same dimension as data shape {self.data_shape}"index = 0for dim in range(len(grid_idx)):index += grid_idx[dim] * self.grid_co... | 2 | 8 | 2 | 54 | 0 | 117 | 127 | 117 | self,grid_idx | [] | Returns | {"Assign": 1, "AugAssign": 1, "Expr": 1, "For": 1, "Return": 1} | 5 | 11 | 5 | ["len", "len", "range", "len", "self.grid_count"] | 0 | [] | The function (dataset_idx_from_grid_idx) defined within the public class called GridIndexManager.The function start at line 117 and ends at 127. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [117.0], and this function return a value. It declares 5.0 functions... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_patch_location_from_dataset_idx | def get_patch_location_from_dataset_idx(self, dataset_idx: int):"""Returns the patch location of the grid in the dataset."""grid_location = self.get_location_from_dataset_idx(dataset_idx)offset = self.patch_offset()return tuple(np.array(grid_location) - np.array(offset)) | 1 | 4 | 2 | 42 | 0 | 129 | 135 | 129 | self,dataset_idx | [] | Returns | {"Assign": 2, "Expr": 1, "Return": 1} | 5 | 7 | 5 | ["self.get_location_from_dataset_idx", "self.patch_offset", "tuple", "np.array", "np.array"] | 0 | [] | The function (get_patch_location_from_dataset_idx) defined within the public class called GridIndexManager.The function start at line 129 and ends at 135. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [129.0], and this function return a value. It declares 5.0... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_dataset_idx_from_grid_location | def get_dataset_idx_from_grid_location(self, location: tuple):assert len(location) == len(self.data_shape), f"Location {location} must have the same dimension as data shape {self.data_shape}"grid_idx = [self.get_grid_index(dim, location[dim]) for dim in range(len(location))]return self.dataset_idx_from_grid_idx(tuple(g... | 2 | 8 | 2 | 59 | 0 | 137 | 144 | 137 | self,location | [] | Returns | {"Assign": 1, "Return": 1} | 7 | 8 | 7 | ["len", "len", "self.get_grid_index", "range", "len", "self.dataset_idx_from_grid_idx", "tuple"] | 0 | [] | The function (get_dataset_idx_from_grid_location) defined within the public class called GridIndexManager.The function start at line 137 and ends at 144. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [137.0], and this function return a value. It declares 7.0 ... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_gridstart_location_from_dim_index | def get_gridstart_location_from_dim_index(self, dim: int, dim_index: int):"""Returns the grid-start coordinate of the grid in the specified dimension."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"#... | 7 | 20 | 3 | 185 | 0 | 146 | 173 | 146 | self,dim,dim_index | [] | Returns | {"Assign": 2, "Expr": 1, "If": 5, "Return": 5} | 3 | 28 | 3 | ["len", "self.get_individual_dim_grid_count", "ValueError"] | 0 | [] | The function (get_gridstart_location_from_dim_index) defined within the public class called GridIndexManager.The function start at line 146 and ends at 173. It contains 20 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [146.0], and this function return a value. It declares ... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_location_from_dataset_idx | def get_location_from_dataset_idx(self, dataset_idx: int):"""Returns the start location of the grid in the dataset."""grid_idx = []for dim in range(len(self.data_shape)):grid_idx.append(dataset_idx // self.grid_count(dim))dataset_idx = dataset_idx % self.grid_count(dim)location = [self.get_gridstart_location_from_dim_i... | 3 | 10 | 2 | 75 | 0 | 175 | 187 | 175 | self,dataset_idx | [] | Returns | {"Assign": 3, "Expr": 2, "For": 1, "Return": 1} | 9 | 13 | 9 | ["range", "len", "grid_idx.append", "self.grid_count", "self.grid_count", "self.get_gridstart_location_from_dim_index", "range", "len", "tuple"] | 0 | [] | The function (get_location_from_dataset_idx) defined within the public class called GridIndexManager.The function start at line 175 and ends at 187. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [175.0], and this function return a value. It declares 9.0 func... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | on_boundary | def on_boundary(self, dataset_idx: int, dim: int, only_end: bool = False):"""Returns True if the grid is on the boundary in the specified dimension."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"if ... | 4 | 13 | 4 | 90 | 0 | 189 | 207 | 189 | self,dataset_idx,dim,only_end | [] | Returns | {"Assign": 2, "Expr": 1, "If": 2, "Return": 2} | 5 | 19 | 5 | ["len", "self.grid_count", "self.grid_count", "self.get_individual_dim_grid_count", "self.get_individual_dim_grid_count"] | 0 | [] | The function (on_boundary) defined within the public class called GridIndexManager.The function start at line 189 and ends at 207. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [189.0], and this function return a value. It declares 5.0 functions, and It has... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | next_grid_along_dim | def next_grid_along_dim(self, dataset_idx: int, dim: int):"""Returns the index of the grid in the specified dimension in the specified direction."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"new_id... | 2 | 9 | 3 | 55 | 0 | 209 | 220 | 209 | self,dataset_idx,dim | [] | Returns | {"Assign": 1, "Expr": 1, "If": 1, "Return": 2} | 3 | 12 | 3 | ["len", "self.grid_count", "self.total_grid_count"] | 0 | [] | The function (next_grid_along_dim) defined within the public class called GridIndexManager.The function start at line 209 and ends at 220. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [209.0], and this function return a value. It declares 3.0 functions, and ... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | prev_grid_along_dim | def prev_grid_along_dim(self, dataset_idx: int, dim: int):"""Returns the index of the grid in the specified dimension in the specified direction."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"new_id... | 2 | 8 | 3 | 49 | 0 | 222 | 232 | 222 | self,dataset_idx,dim | [] | Returns | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 2 | 11 | 2 | ["len", "self.grid_count"] | 0 | [] | The function (prev_grid_along_dim) defined within the public class called GridIndexManager.The function start at line 222 and ends at 232. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [222.0], and this function return a value. It declares 2.0 functions, and ... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | __post_init__ | def __post_init__(self):if len(self.data_shapes) > 1:assert {len(ds) for ds in self.data_shapes[0]}.pop() == {len(ds) for ds in self.data_shapes[1]}.pop(), "Data shape for all channels must be the same"# TODO better way to assert thisassert {len(ds) for ds in self.data_shapes[0]}.pop() == len(self.grid_shape), "Data sh... | 9 | 22 | 1 | 180 | 0 | 250 | 271 | 250 | self | [] | None | {"Assign": 1, "For": 1, "If": 2} | 9 | 17 | 9 | ["len", "len", "len", "len", "np.array", "np.array", "enumerate", "ValueError", "ValueError"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953269_alisaifee_flask_limiter.flask_limiter._limits_py.RouteLimit.__post_init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.88805393_amisadmin_fastapi_amis_admin.fastapi_amis_admin.admin.extensions.schemas_py.... | The function (__post_init__) defined within the public class called GridIndexManager.The function start at line 250 and ends at 271. It contains 22 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value. It declares 9.0 functions, It has 9.0 functi... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | patch_offset | def patch_offset(self):return (np.array(self.patch_shape) - np.array(self.grid_shape)) // 2 | 1 | 2 | 1 | 26 | 0 | 273 | 274 | 38 | self | [] | Returns | {"Return": 1} | 2 | 2 | 2 | ["np.array", "np.array"] | 0 | [] | The function (patch_offset) defined within the public class called GridIndexManager.The function start at line 273 and ends at 274. 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 has 2.0... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_individual_dim_grid_count | def get_individual_dim_grid_count(self, shape: tuple, dim: int):"""Returns the number of the grid in the specified dimension, ignoring all other dimensions."""# assert that dim is less than the number of dimensions in data shape# if dim > len()if self.grid_shape[dim] == 1 and self.patch_shape[dim] == 1:return shape[dim... | 5 | 11 | 3 | 156 | 0 | 276 | 296 | 276 | self,dim | [] | Returns | {"Assign": 2, "Expr": 1, "If": 3, "Return": 4} | 7 | 23 | 7 | ["len", "int", "np.ceil", "int", "np.ceil", "int", "np.floor"] | 0 | [] | The function (get_individual_dim_grid_count) defined within the public class called GridIndexManager.The function start at line 276 and ends at 296. It contains 11 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [276.0], and this function return a value. It declares 7.0 func... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | total_grid_count | def total_grid_count(self):"""Returns the total number of patches in the dataset."""len_per_channel = []num_patches_per_sample = []for channel_data in self.data_shapes:num_patches = []for file_shape in channel_data:num_patches.append(np.prod(self.grid_count_per_sample(file_shape)))len_per_channel.append(np.sum(num_patc... | 3 | 10 | 1 | 67 | 0 | 298 | 309 | 298 | self | [] | Returns | {"Expr": 1, "Return": 1} | 2 | 5 | 2 | ["self.grid_count", "self.get_individual_dim_grid_count"] | 0 | [] | The function (total_grid_count) defined within the public class called GridIndexManager.The function start at line 298 and ends at 309. It contains 10 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and It ha... |
CAREamics_careamics | GridIndexManagerRef | public | 0 | 0 | grid_count_per_sample | def grid_count_per_sample(self, shape: tuple):"""Returns the total number of patches for one dimension."""grid_count = []for dim in range(len(shape)):grid_count.append(self.get_individual_dim_grid_count(shape, dim))return grid_count | 2 | 5 | 2 | 40 | 0 | 311 | 316 | 311 | self,shape | [] | Returns | {"Assign": 1, "Expr": 2, "For": 1, "Return": 1} | 4 | 6 | 4 | ["range", "len", "grid_count.append", "self.get_individual_dim_grid_count"] | 0 | [] | The function (grid_count_per_sample) defined within the public class called GridIndexManagerRef.The function start at line 311 and ends at 316. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [311.0], and this function return a value. It declares 4.0 functions,... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_grid_index | def get_grid_index(self, shape, dim: int, coordinate: int):"""Returns the index of the patch in the specified dimension."""assert dim < len(shape), f"Dimension {dim} is out of bounds for data shape {shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"assert (coordinate < shape[dim]), f"Coordinate {coo... | 7 | 25 | 4 | 228 | 0 | 318 | 347 | 318 | self,dim,coordinate | [] | Returns | {"Assign": 2, "Expr": 1, "If": 5, "Return": 5} | 8 | 32 | 8 | ["len", "np.floor", "max", "np.floor", "self.get_individual_dim_grid_count", "max", "np.floor", "ValueError"] | 0 | [] | The function (get_grid_index) defined within the public class called GridIndexManager.The function start at line 318 and ends at 347. It contains 25 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [318.0], and this function return a value. It declares 8.0 functions, and It ... |
CAREamics_careamics | GridIndexManagerRef | public | 0 | 0 | patch_idx_from_grid_idx | def patch_idx_from_grid_idx(self, shape: tuple, grid_idx: tuple):"""Returns the index of the patch in the dataset."""assert len(grid_idx) == len(shape), f"Dimension indices {grid_idx} must have the same dimension as data shape {shape}"index = 0for dim in range(len(grid_idx)):index += grid_idx[dim] * self.grid_count(sha... | 2 | 8 | 3 | 58 | 0 | 349 | 357 | 349 | self,shape,grid_idx | [] | Returns | {"Assign": 1, "AugAssign": 1, "Expr": 1, "For": 1, "Return": 1} | 5 | 9 | 5 | ["len", "len", "range", "len", "self.grid_count"] | 0 | [] | The function (patch_idx_from_grid_idx) defined within the public class called GridIndexManagerRef.The function start at line 349 and ends at 357. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [349.0], and this function return a value. It declares 5.0 function... |
CAREamics_careamics | GridIndexManagerRef | public | 0 | 0 | get_patch_location_from_patch_idx | def get_patch_location_from_patch_idx(self, ch_idx: int, patch_idx: int):"""Returns the patch location of the grid in the dataset."""grid_location = self.get_location_from_patch_idx(ch_idx, patch_idx)offset = self.patch_offset()return tuple(np.array(grid_location) - np.concatenate((np.array((0,)), offset))) | 1 | 4 | 3 | 60 | 0 | 359 | 363 | 359 | self,ch_idx,patch_idx | [] | Returns | {"Assign": 2, "Expr": 1, "Return": 1} | 6 | 5 | 6 | ["self.get_location_from_patch_idx", "self.patch_offset", "tuple", "np.array", "np.concatenate", "np.array"] | 0 | [] | The function (get_patch_location_from_patch_idx) defined within the public class called GridIndexManagerRef.The function start at line 359 and ends at 363. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [359.0], and this function return a value. It declares 6.... |
CAREamics_careamics | GridIndexManagerRef | public | 0 | 0 | get_patch_idx_from_grid_location | def get_patch_idx_from_grid_location(self, shape, location: tuple):assert len(location) == len(shape), f"Location {location} must have the same dimension as data shape {shape}"grid_idx = [self.get_grid_index(dim, location[dim]) for dim in range(len(location))]return self.patch_idx_from_grid_idx(tuple(grid_idx)) | 2 | 8 | 3 | 59 | 0 | 365 | 372 | 365 | self,shape,location | [] | Returns | {"Assign": 1, "Return": 1} | 7 | 8 | 7 | ["len", "len", "self.get_grid_index", "range", "len", "self.patch_idx_from_grid_idx", "tuple"] | 0 | [] | The function (get_patch_idx_from_grid_location) defined within the public class called GridIndexManagerRef.The function start at line 365 and ends at 372. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [365.0], and this function return a value. It declares 7.0... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | get_gridstart_location_from_dim_index | def get_gridstart_location_from_dim_index(self, shape: tuple, dim_idx: int, dim: int):"""Returns the grid-start coordinate of the grid in the specified dimension.dim_idx: intIndex of the dimension in the data shape.dim: intValue of the dimension in the grid (relative to num patches in dimension)."""if self.grid_shape[d... | 5 | 13 | 4 | 115 | 0 | 374 | 394 | 374 | self,dim,dim_index | [] | Returns | {"Assign": 2, "Expr": 1, "If": 5, "Return": 5} | 3 | 28 | 3 | ["len", "self.get_individual_dim_grid_count", "ValueError"] | 0 | [] | The function (get_gridstart_location_from_dim_index) defined within the public class called GridIndexManager.The function start at line 374 and ends at 394. It contains 13 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [374.0], and this function return a value. It declares ... |
CAREamics_careamics | GridIndexManagerRef | public | 0 | 0 | get_location_from_patch_idx | def get_location_from_patch_idx(self, channel_idx: int, patch_idx: int):"""Returns the start location of the grid in the dataset. Per channel!.Parameters----------patch_idx : intThe index of the patch in a list of samples within a channel. Channels canbe different in length."""# TODO assert patch_idx <= num of patches ... | 4 | 20 | 3 | 172 | 0 | 396 | 432 | 396 | self,channel_idx,patch_idx | [] | Returns | {"Assign": 8, "AugAssign": 1, "Expr": 2, "For": 1, "Return": 1} | 12 | 37 | 12 | ["np.cumsum", "self.total_grid_count", "np.searchsorted", "self.grid_count_per_sample", "range", "len", "np.prod", "grid_idx.insert", "self.get_gridstart_location_from_dim_index", "range", "len", "tuple"] | 0 | [] | The function (get_location_from_patch_idx) defined within the public class called GridIndexManagerRef.The function start at line 396 and ends at 432. It contains 20 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [396.0], and this function return a value. It declares 12.0 fu... |
CAREamics_careamics | GridIndexManagerRef | public | 0 | 0 | get_location_from_patch_idx_o | def get_location_from_patch_idx_o(self, dataset_idx: int):"""Returns the start location of the grid in the dataset."""grid_idx = []for dim in range(len(self.data_shape)):grid_idx.append(dataset_idx // self.grid_count(dim))dataset_idx = dataset_idx % self.grid_count(dim)location = [self.get_gridstart_location_from_dim_i... | 3 | 10 | 2 | 75 | 0 | 434 | 446 | 434 | self,dataset_idx | [] | Returns | {"Assign": 3, "Expr": 2, "For": 1, "Return": 1} | 9 | 13 | 9 | ["range", "len", "grid_idx.append", "self.grid_count", "self.grid_count", "self.get_gridstart_location_from_dim_index", "range", "len", "tuple"] | 0 | [] | The function (get_location_from_patch_idx_o) defined within the public class called GridIndexManagerRef.The function start at line 434 and ends at 446. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [434.0], and this function return a value. It declares 9.0 f... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | on_boundary | def on_boundary(self, dataset_idx: int, dim: int, only_end: bool = False):"""Returns True if the grid is on the boundary in the specified dimension."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"if ... | 4 | 13 | 4 | 90 | 0 | 448 | 466 | 189 | self,dataset_idx,dim,only_end | [] | Returns | {"Assign": 2, "Expr": 1, "If": 2, "Return": 2} | 5 | 19 | 5 | ["len", "self.grid_count", "self.grid_count", "self.get_individual_dim_grid_count", "self.get_individual_dim_grid_count"] | 0 | [] | The function (on_boundary) defined within the public class called GridIndexManager.The function start at line 448 and ends at 466. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [189.0], and this function return a value. It declares 5.0 functions, and It has... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | next_grid_along_dim | def next_grid_along_dim(self, dataset_idx: int, dim: int):"""Returns the index of the grid in the specified dimension in the specified direction."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"new_id... | 2 | 9 | 3 | 55 | 0 | 468 | 479 | 209 | self,dataset_idx,dim | [] | Returns | {"Assign": 1, "Expr": 1, "If": 1, "Return": 2} | 3 | 12 | 3 | ["len", "self.grid_count", "self.total_grid_count"] | 0 | [] | The function (next_grid_along_dim) defined within the public class called GridIndexManager.The function start at line 468 and ends at 479. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [209.0], and this function return a value. It declares 3.0 functions, and ... |
CAREamics_careamics | GridIndexManager | public | 0 | 0 | prev_grid_along_dim | def prev_grid_along_dim(self, dataset_idx: int, dim: int):"""Returns the index of the grid in the specified dimension in the specified direction."""assert dim < len(self.data_shape), f"Dimension {dim} is out of bounds for data shape {self.data_shape}"assert dim >= 0, "Dimension must be greater than or equal to 0"new_id... | 2 | 8 | 3 | 49 | 0 | 481 | 491 | 222 | self,dataset_idx,dim | [] | Returns | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 2 | 11 | 2 | ["len", "self.grid_count"] | 0 | [] | The function (prev_grid_along_dim) defined within the public class called GridIndexManager.The function start at line 481 and ends at 491. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [222.0], and this function return a value. It declares 2.0 functions, and ... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | __init__ | def __init__(self, idx_manager, data_config, patch_size) -> None:self.idx_manager = idx_managerself._data_shape = self.idx_manager.get_data_shape()self._training_validtarget_fraction = data_config.get("training_validtarget_fraction", 1.0)self._validtarget_ceilT = int(np.ceil(self._data_shape[0] * self._training_validta... | 4 | 28 | 4 | 154 | 0 | 13 | 42 | 13 | self,idx_manager,data_config,patch_size | [] | None | {"Assign": 8, "Expr": 2, "If": 1} | 7 | 30 | 7 | ["self.idx_manager.get_data_shape", "data_config.get", "int", "np.ceil", "self.get_reduced_frame_size", "print", "print"] | 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 IndexSwitcher.The function start at line 13 and ends at 42. It contains 28 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [13.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions cal... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | get_valid_target_index | def get_valid_target_index(self):"""Returns an index which corresponds to a frame which is expected to have a target."""_, h, w, _ = self._data_shapeframepixelcount = h * wtargetpixels = np.array([framepixelcount] * (self._validtarget_ceilT - 1)+ [self._h_validmax * self._w_validmax])targetpixels = targetpixels / np.su... | 1 | 12 | 1 | 102 | 0 | 44 | 60 | 44 | self | [] | Returns | {"Assign": 7, "Expr": 1, "Return": 1} | 5 | 17 | 5 | ["np.array", "np.sum", "np.random.choice", "self.get_valid_target_hw", "self.idx_manager.idx_from_hwt"] | 0 | [] | The function (get_valid_target_index) defined within the public class called IndexSwitcher.The function start at line 44 and ends at 60. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 functions, and It h... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | get_invalid_target_index | def get_invalid_target_index(self):# if self._validtarget_ceilT == 0:# TODO: There may not be enough data for this to work. The better way is to skip using 0 for invalid target.# t = np.random.randint(1, self._data_shape[0])# elif self._validtarget_ceilT < self._data_shape[0]:# t = np.random.randint(self._validtarget_c... | 3 | 20 | 1 | 140 | 0 | 62 | 93 | 62 | self | [] | Returns | {"Assign": 11, "If": 2, "Return": 1} | 6 | 32 | 6 | ["np.array", "np.sum", "np.random.choice", "np.arange", "self.get_invalid_target_hw", "self.idx_manager.idx_from_hwt"] | 0 | [] | The function (get_invalid_target_index) defined within the public class called IndexSwitcher.The function start at line 62 and ends at 93. It contains 20 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 6.0 functions, and It... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | get_valid_target_hw | def get_valid_target_hw(self, t):"""This is the opposite of get_invalid_target_hw. It returns a h,w which is valid for target.This is only valid for single frame setup."""if t == self._validtarget_ceilT - 1:h = np.random.randint(0, self._h_validmax - self._patch_size)w = np.random.randint(0, self._w_validmax - self._pa... | 2 | 8 | 2 | 101 | 0 | 95 | 106 | 95 | self,t | [] | Returns | {"Assign": 4, "Expr": 1, "If": 1, "Return": 1} | 4 | 12 | 4 | ["np.random.randint", "np.random.randint", "np.random.randint", "np.random.randint"] | 0 | [] | The function (get_valid_target_hw) defined within the public class called IndexSwitcher.The function start at line 95 and ends at 106. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [95.0], and this function return a value. It declares 4.0 functions, and It h... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | get_invalid_target_hw | def get_invalid_target_hw(self, t):"""This is the opposite of get_valid_target_hw. It returns a h,w which is not valid for target.This is only valid for single frame setup."""if t == self._validtarget_ceilT - 1:h = np.random.randint(self._h_validmax, self._data_shape[1] - self._patch_size)w = np.random.randint(self._w_... | 2 | 12 | 2 | 111 | 0 | 108 | 123 | 108 | self,t | [] | Returns | {"Assign": 4, "Expr": 1, "If": 1, "Return": 1} | 4 | 16 | 4 | ["np.random.randint", "np.random.randint", "np.random.randint", "np.random.randint"] | 0 | [] | The function (get_invalid_target_hw) defined within the public class called IndexSwitcher.The function start at line 108 and ends at 123. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [108.0], and this function return a value. It declares 4.0 functions, and ... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | _get_tidx | def _get_tidx(self, index):if isinstance(index, int) or isinstance(index, np.int64):idx = indexelse:idx = index[0]return self.idx_manager.get_t(idx) | 3 | 6 | 2 | 44 | 0 | 125 | 130 | 125 | self,index | [] | Returns | {"Assign": 2, "If": 1, "Return": 1} | 3 | 6 | 3 | ["isinstance", "isinstance", "self.idx_manager.get_t"] | 0 | [] | The function (_get_tidx) defined within the public class called IndexSwitcher.The function start at line 125 and ends at 130. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [125.0], and this function return a value. It declares 3.0 functions, and It has 3.0 f... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | index_should_have_target | def index_should_have_target(self, index):tidx = self._get_tidx(index)if tidx < self._validtarget_ceilT - 1:return Trueelif tidx > self._validtarget_ceilT - 1:return Falseelse:h, w, _ = self.idx_manager.hwt_from_idx(index)return (h + self._patch_size < self._h_validmaxand w + self._patch_size < self._w_validmax) | 4 | 12 | 2 | 75 | 0 | 132 | 143 | 132 | self,index | [] | Returns | {"Assign": 2, "If": 2, "Return": 3} | 2 | 12 | 2 | ["self._get_tidx", "self.idx_manager.hwt_from_idx"] | 0 | [] | The function (index_should_have_target) defined within the public class called IndexSwitcher.The function start at line 132 and ends at 143. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [132.0], and this function return a value. It declares 2.0 functions, a... |
CAREamics_careamics | IndexSwitcher | public | 0 | 0 | get_reduced_frame_size | def get_reduced_frame_size(data_shape_nhw, fraction):n, h, w = data_shape_nhwframepixelcount = h * wtargetpixelcount = int(n * framepixelcount * fraction)# We are currently supporting this only when there is just one frame.# if np.ceil(pixelcount / framepixelcount) > 1:# return None, Nonelastframepixelcount = targetpix... | 2 | 14 | 2 | 80 | 0 | 146 | 165 | 146 | data_shape_nhw,fraction | [] | Returns | {"Assign": 5, "If": 1, "Return": 2} | 3 | 20 | 3 | ["int", "int", "np.sqrt"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.multich_dataset_py.MultiChDloader._loaded_data_preprocessing"] | The function (get_reduced_frame_size) defined within the public class called IndexSwitcher.The function start at line 146 and ends at 165. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [146.0], and this function return a value. It declares 3.0 functions, It ... |
CAREamics_careamics | public | public | 0 | 0 | _export_state_dict | def _export_state_dict(model: Union[FCNModule, VAEModule], path: Union[Path, str]) -> Path:"""Export the model state dictionary to a file.Parameters----------model : CAREamicsKilnCAREamics model to export.path : Union[Path, str]Path to the file where to save the model state dictionary.Returns-------PathPath to the save... | 2 | 8 | 2 | 60 | 1 | 28 | 57 | 28 | model,path | ['path'] | Path | {"Assign": 2, "Expr": 2, "If": 1, "Return": 1} | 4 | 30 | 4 | ["Path", "path.with_suffix", "save", "model.model.state_dict"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bmz_io_py.export_to_bmz", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.model_io.test_bmz_io_py.test_state_dict_io"] | The function (_export_state_dict) defined within the public class called public.The function start at line 28 and ends at 57. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [28.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions c... |
CAREamics_careamics | public | public | 0 | 0 | _load_state_dict | def _load_state_dict(model: Union[FCNModule, VAEModule], path: Union[Path, str]) -> None:"""Load a model from a state dictionary.Parameters----------model : CAREamicsKilnCAREamics model to be updated with the weights.path : Union[Path, str]Path to the model state dictionary."""path = Path(path)# load model state dictio... | 1 | 6 | 2 | 44 | 2 | 60 | 79 | 60 | model,path | ['state_dict', 'path'] | None | {"Assign": 2, "Expr": 2} | 3 | 20 | 3 | ["Path", "load", "model.model.load_state_dict"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bmz_io_py.load_from_bmz", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.model_io.test_bmz_io_py.test_state_dict_io"] | The function (_load_state_dict) defined within the public class called public.The function start at line 60 and ends at 79. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [60.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions cal... |
CAREamics_careamics | public | public | 0 | 0 | export_to_bmz | def export_to_bmz(model: Union[FCNModule, VAEModule],config: Configuration,path_to_archive: Union[Path, str],model_name: str,general_description: str,data_description: str,authors: list[dict],input_array: np.ndarray,output_array: np.ndarray,covers: list[Union[Path, str]] | None = None,channel_names: list[str] | None = ... | 7 | 63 | 12 | 385 | 12 | 83 | 203 | 83 | model,config,path_to_archive,model_name,general_description,data_description,authors,input_array,output_array,covers,channel_names,model_version | ['outputs', 'temp_path', 'covers', 'weight_path', 'config_path', 'bioimageio_config', 'env_path', 'path_to_archive', 'careamics_version', 'test_kwargs', 'inputs', 'model_description'] | None | {"AnnAssign": 1, "Assign": 13, "Expr": 6, "If": 5, "With": 1} | 23 | 121 | 23 | ["Path", "ValueError", "path_to_archive.parent.exists", "path_to_archive.parent.mkdir", "get_careamics_version", "tempfile.TemporaryDirectory", "Path", "env_path.write_text", "create_env_text", "np.save", "np.save", "save_configuration", "_export_state_dict", "create_cover", "create_model_description", "hasattr", "isin... | 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 public.The function start at line 83 and ends at 203. It contains 63 lines of code and it has a cyclomatic complexity of 7. It takes 12 parameters, represented as [83.0] and does not return any value. It declares 23.0 functions, It has 23.0 functions c... |
CAREamics_careamics | public | public | 0 | 0 | load_from_bmz | def load_from_bmz(path: Union[Path, str, HttpUrl],) -> tuple[Union[FCNModule, VAEModule], Configuration]:"""Load a model from a BioImage Model Zoo archive.Parameters----------path : Path, str or HttpUrlPath to the BioImage Model Zoo archive. A Http URL must point to a downloadablelocation.Returns-------FCNModel or VAEM... | 3 | 16 | 1 | 112 | 3 | 206 | 251 | 206 | path | ['config', 'model_desc', 'model'] | tuple[Union[FCNModule, VAEModule], Configuration] | {"Assign": 5, "Expr": 2, "If": 2, "Return": 1} | 7 | 46 | 7 | ["load_model_description", "extract_model_path", "load_configuration", "FCNModule", "VAEModule", "ValueError", "_load_state_dict"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.model_io_utils_py.load_pretrained"] | The function (load_from_bmz) defined within the public class called public.The function start at line 206 and ends at 251. It contains 16 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 7.0 functions, It has 7.0 functions called... |
CAREamics_careamics | public | public | 0 | 0 | load_pretrained | def load_pretrained(path: Union[Path, str],) -> tuple[Union[FCNModule, VAEModule], Configuration]:"""Load a pretrained model from a checkpoint or a BioImage Model Zoo model.Expected formats are .ckpt or .zip files.Parameters----------path : Union[Path, str]Path to the pretrained model.Returns-------tuple[CAREamicsKiln,... | 3 | 12 | 1 | 64 | 1 | 14 | 46 | 14 | path | ['path'] | tuple[Union[FCNModule, VAEModule], Configuration] | {"Assign": 1, "Expr": 1, "If": 2, "Return": 2} | 4 | 33 | 4 | ["check_path_exists", "_load_checkpoint", "load_from_bmz", "ValueError"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.careamist_py.CAREamist.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.model_io.test_bmz_io_py.test_bmz_io"] | The function (load_pretrained) defined within the public class called public.The function start at line 14 and ends at 46. It contains 12 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, It has 4.0 functions called... |
CAREamics_careamics | public | public | 0 | 0 | _load_checkpoint | def _load_checkpoint(path: Union[Path, str],) -> tuple[Union[FCNModule, VAEModule], Configuration]:"""Load a model from a checkpoint and return both model and configuration.Parameters----------path : Union[Path, str]Path to the checkpoint.Returns-------tuple[CAREamicsKiln, Configuration]tuple of CAREamics model and its... | 5 | 22 | 1 | 142 | 3 | 49 | 95 | 49 | path | ['cfg_dict', 'device', 'model'] | tuple[Union[FCNModule, VAEModule], Configuration] | {"AnnAssign": 1, "Assign": 4, "Expr": 1, "If": 2, "Return": 1, "Try": 1} | 9 | 47 | 9 | ["torch.device", "torch.cuda.is_available", "torch.load", "ValueError", "checkpoint.keys", "FCNModule.load_from_checkpoint", "VAEModule.load_from_checkpoint", "ValueError", "Configuration"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.model_io_utils_py.load_pretrained"] | The function (_load_checkpoint) defined within the public class called public.The function start at line 49 and ends at 95. It contains 22 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 9.0 functions, It has 9.0 functions calle... |
CAREamics_careamics | public | public | 0 | 0 | _yaml_block | def _yaml_block(yaml_str: str) -> str:"""Return a markdown code block with a yaml string.Parameters----------yaml_str : strYAML string.Returns-------strMarkdown code block with the YAML string."""return f"```yaml\n{yaml_str}\n```" | 1 | 2 | 1 | 13 | 0 | 11 | 24 | 11 | yaml_str | [] | str | {"Expr": 1, "Return": 1} | 0 | 14 | 0 | [] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage._readme_factory_py.readme_factory"] | The function (_yaml_block) defined within the public class called public.The function start at line 11 and ends at 24. 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 1.0 function calling this function which is ["_.cont... |
CAREamics_careamics | public | public | 0 | 0 | readme_factory | def readme_factory(config: Configuration,careamics_version: str,data_description: str,) -> Path:"""Create a README file for the model.`data_description` can be used to add more information about the content of thedata the model was trained on.Parameters----------config : ConfigurationCAREamics configuration.careamics_v... | 2 | 46 | 3 | 211 | 5 | 27 | 113 | 27 | config,careamics_version,data_description | ['readme', 'algorithm_flavour', 'description', 'reference', 'algorithm_pretty_name'] | Path | {"Assign": 5, "Expr": 19, "If": 1, "Return": 1, "With": 1} | 29 | 87 | 29 | ["cwd", "get_careamics_home", "Path", "readme.touch", "config.get_algorithm_friendly_name", "description.append", "description.append", "description.append", "description.append", "description.append", "config.get_algorithm_description", "description.append", "description.append", "description.append", "description.app... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage.model_description_py.create_model_description"] | The function (readme_factory) defined within the public class called public.The function start at line 27 and ends at 113. It contains 46 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [27.0] and does not return any value. It declares 29.0 functions, It has 29.0 functions c... |
CAREamics_careamics | public | public | 0 | 0 | get_unzip_path | def get_unzip_path(zip_path: Union[Path, str]) -> Path:"""Generate unzipped folder path from the bioimage.io model path.Parameters----------zip_path : PathPath to the bioimage.io model.Returns-------PathPath to the unzipped folder."""zip_path = Path(zip_path)return zip_path.parent / (str(zip_path.name) + ".unzip") | 1 | 3 | 1 | 36 | 1 | 9 | 24 | 9 | zip_path | ['zip_path'] | Path | {"Assign": 1, "Expr": 1, "Return": 1} | 2 | 16 | 2 | ["Path", "str"] | 0 | [] | The function (get_unzip_path) defined within the public class called public.The function start at line 9 and ends at 24. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions call... |
CAREamics_careamics | public | public | 0 | 0 | create_env_text | def create_env_text(pytorch_version: str, torchvision_version: str) -> str:"""Create environment yaml content for the bioimage model.This installs an environment with the specified pytorch version and the latestchanges to careamics.Parameters----------pytorch_version : strPytorch version.torchvision_version : strTorchv... | 1 | 12 | 2 | 36 | 1 | 27 | 56 | 27 | pytorch_version,torchvision_version | ['env'] | str | {"Assign": 1, "Expr": 1, "Return": 1} | 1 | 30 | 1 | ["get_careamics_version"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bmz_io_py.export_to_bmz"] | The function (create_env_text) defined within the public class called public.The function start at line 27 and ends at 56. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [27.0] and does not return any value. It declare 1.0 function, It has 1.0 function called... |
CAREamics_careamics | public | public | 0 | 0 | _get_norm_slice | def _get_norm_slice(array: NDArray) -> NDArray:"""Get the normalized middle slice of a 4D or 5D array (SC(Z)YX).Parameters----------array : NDArrayArray from which to get the middle slice.Returns-------NDArrayNormalized middle slice of the input array."""if array.ndim not in (4, 5):raise ValueError("Array must be 4D or... | 4 | 19 | 1 | 136 | 3 | 19 | 57 | 19 | array | ['channels', 'z_stack', 'array_slice'] | NDArray | {"Assign": 7, "Expr": 1, "If": 3, "Return": 1} | 6 | 39 | 6 | ["ValueError", "np.moveaxis", "array_slice.min", "array_slice.max", "array_slice.min", "array_slice.astype"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage.cover_factory_py.create_cover"] | The function (_get_norm_slice) defined within the public class called public.The function start at line 19 and ends at 57. It contains 19 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 functions called... |
CAREamics_careamics | public | public | 0 | 0 | _four_channel_image | def _four_channel_image(array: NDArray) -> Image:"""Convert 4-channel array to Image.Parameters----------array : NDArrayNormalized array to convert.Returns-------ImageConverted array."""colors = color_palette[np.newaxis, np.newaxis, :, :]four_c_array = np.sum(array[..., :4, np.newaxis] * colors, axis=-2).astype(np.uint... | 1 | 4 | 1 | 70 | 2 | 60 | 76 | 60 | array | ['four_c_array', 'colors'] | Image | {"Assign": 2, "Expr": 1, "Return": 1} | 4 | 17 | 4 | ["astype", "np.sum", "convert", "Image.fromarray"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage.cover_factory_py._convert_to_image"] | The function (_four_channel_image) defined within the public class called public.The function start at line 60 and ends at 76. 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 cal... |
CAREamics_careamics | public | public | 0 | 0 | _convert_to_image | def _convert_to_image(original_shape: tuple[int, ...], array: NDArray) -> Image:"""Convert to Image.Parameters----------original_shape : tupleOriginal shape of the array.array : NDArrayNormalized array to convert.Returns-------ImageConverted array."""n_channels = original_shape[1]if n_channels > 1:if n_channels == 3:re... | 4 | 12 | 2 | 125 | 2 | 79 | 107 | 79 | original_shape,array | ['n_channels', 'array'] | Image | {"Assign": 2, "Expr": 1, "If": 3, "Return": 4} | 10 | 29 | 10 | ["convert", "Image.fromarray", "np.concatenate", "np.zeros_like", "convert", "Image.fromarray", "_four_channel_image", "convert", "convert", "Image.fromarray"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage.cover_factory_py.create_cover"] | The function (_convert_to_image) defined within the public class called public.The function start at line 79 and ends at 107. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [79.0] and does not return any value. It declares 10.0 functions, It has 10.0 function... |
CAREamics_careamics | public | public | 0 | 0 | create_cover | def create_cover(directory: Path, array_in: NDArray, array_out: NDArray) -> Path:"""Create a cover image from input and output arrays.Input and output arrays are expected to be SC(Z)YX. For images with a Zdimension, the middle slice is taken.Parameters----------directory : PathDirectory in which to save the cover.array... | 4 | 32 | 3 | 281 | 9 | 110 | 171 | 110 | directory,array_in,array_out | ['image_out', 'cover', 'cover_path', 'image_in', 'slice_in', 'width', 'slice_out', 'horizontal_split', 'height'] | Path | {"Assign": 10, "Expr": 6, "If": 3, "Return": 1} | 16 | 62 | 16 | ["_get_norm_slice", "_get_norm_slice", "ValueError", "_convert_to_image", "_convert_to_image", "Image.new", "cover.paste", "image_in.crop", "cover.paste", "image_out.crop", "Image.new", "cover.paste", "image_in.crop", "cover.paste", "image_out.crop", "cover.save"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bmz_io_py.export_to_bmz"] | The function (create_cover) defined within the public class called public.The function start at line 110 and ends at 171. It contains 32 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [110.0] and does not return any value. It declares 16.0 functions, It has 16.0 functions c... |
CAREamics_careamics | public | public | 0 | 0 | _create_axes | def _create_axes(array: np.ndarray,data_config: DataConfig,channel_names: list[str] | None = None,is_input: bool = True,) -> list[AxisBase]:"""Create axes description.Array shape is expected to be SC(Z)YX.Parameters----------array : np.ndarrayArray.data_config : DataModelCAREamics data configuration.channel_names : Opt... | 7 | 31 | 4 | 210 | 2 | 35 | 98 | 35 | array,data_config,channel_names,is_input | ['spatial_axes', 'axes_model'] | list[AxisBase] | {"Assign": 2, "Expr": 5, "For": 1, "If": 4, "Return": 1} | 19 | 64 | 19 | ["replace", "data_config.axes.replace", "BatchAxis", "axes_model.append", "ChannelAxis", "Identifier", "ValueError", "axes_model.append", "ChannelAxis", "Identifier", "enumerate", "axes_model.append", "SpaceInputAxis", "AxisId", "axes.lower", "axes_model.append", "SpaceOutputAxis", "AxisId", "axes.lower"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage.model_description_py._create_inputs_ouputs"] | The function (_create_axes) defined within the public class called public.The function start at line 35 and ends at 98. It contains 31 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [35.0] and does not return any value. It declares 19.0 functions, It has 19.0 functions call... |
CAREamics_careamics | public | public | 0 | 0 | _create_inputs_ouputs | def _create_inputs_ouputs(input_array: np.ndarray,output_array: np.ndarray,data_config: DataConfig,input_path: Union[Path, str],output_path: Union[Path, str],channel_names: list[str] | None = None,) -> tuple[InputTensorDescr, OutputTensorDescr]:"""Create input and output tensor description.Input and output paths must p... | 4 | 48 | 6 | 277 | 9 | 101 | 182 | 101 | input_array,output_array,data_config,input_path,output_path,channel_names | ['inv_stds', 'output_descr', 'eps', 'input_axes', 'means', 'input_descr', 'inv_means', 'output_axes', 'stds'] | tuple[InputTensorDescr, OutputTensorDescr] | {"Assign": 9, "Expr": 3, "For": 1, "If": 1, "Return": 1} | 16 | 82 | 16 | ["_create_axes", "_create_axes", "zip", "inv_means.append", "inv_stds.append", "InputTensorDescr", "TensorId", "FileDescr", "FixedZeroMeanUnitVarianceDescr", "FixedZeroMeanUnitVarianceAlongAxisKwargs", "OutputTensorDescr", "TensorId", "FileDescr", "FixedZeroMeanUnitVarianceDescr", "FixedZeroMeanUnitVarianceAlongAxisKwa... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioimage.model_description_py.create_model_description"] | The function (_create_inputs_ouputs) defined within the public class called public.The function start at line 101 and ends at 182. It contains 48 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [101.0] and does not return any value. It declares 16.0 functions, It has 16.0 fu... |
CAREamics_careamics | public | public | 0 | 0 | create_model_description | def create_model_description(config: Configuration,name: str,general_description: str,data_description: str,authors: list[Author],inputs: Union[Path, str],outputs: Union[Path, str],weights_path: Union[Path, str],torch_version: str,careamics_version: str,config_path: Union[Path, str],env_path: Union[Path, str],covers: l... | 1 | 73 | 15 | 350 | 4 | 185 | 306 | 185 | config,name,general_description,data_description,authors,inputs,outputs,weights_path,torch_version,careamics_version,config_path,env_path,covers,channel_names,model_version | ['doc', 'architecture_descr', 'weights_descr', 'model'] | ModelDescr | {"Assign": 5, "Expr": 1, "Return": 1} | 15 | 122 | 15 | ["readme_factory", "_create_inputs_ouputs", "np.load", "np.load", "ArchitectureFromLibraryDescr", "config.algorithm_config.model.model_dump", "WeightsDescr", "PytorchStateDictWeightsDescr", "Version", "FileDescr", "Path", "ModelDescr", "config.get_algorithm_keywords", "FileDescr", "config.get_algorithm_citations"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bmz_io_py.export_to_bmz"] | The function (create_model_description) defined within the public class called public.The function start at line 185 and ends at 306. It contains 73 lines of code and it has a cyclomatic complexity of 1. It takes 15 parameters, represented as [185.0] and does not return any value. It declares 15.0 functions, It has 15.... |
CAREamics_careamics | public | public | 0 | 0 | extract_model_path | def extract_model_path(model_desc: ModelDescr) -> tuple[Path, Path]:"""Return the relative path to the weights and configuration files.Parameters----------model_desc : ModelDescrModel description.Returns-------tuple of (path, path)Weights and configuration paths."""if model_desc.weights.pytorch_state_dict is None:raise... | 6 | 16 | 1 | 123 | 4 | 309 | 341 | 309 | model_desc | ['file_path', 'config_path', 'weights_path', 'model_dir'] | tuple[Path, Path] | {"Assign": 5, "Expr": 1, "For": 1, "If": 3, "Return": 1} | 7 | 33 | 7 | ["ValueError", "extract", "model_dir.joinpath", "isinstance", "Path", "model_dir.joinpath", "ValueError"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bmz_io_py.load_from_bmz"] | The function (extract_model_path) defined within the public class called public.The function start at line 309 and ends at 341. 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 c... |
CAREamics_careamics | public | public | 0 | 0 | get_activation | def get_activation(activation: Union[SupportedActivation, str]) -> Callable:"""Get activation function.Parameters----------activation : strActivation function name.Returns-------CallableActivation function."""if activation == SupportedActivation.RELU:return nn.ReLU()elif activation == SupportedActivation.ELU:return nn.... | 8 | 17 | 1 | 117 | 0 | 11 | 40 | 11 | activation | [] | Callable | {"Expr": 1, "If": 7, "Return": 7} | 8 | 30 | 8 | ["nn.ReLU", "nn.ELU", "nn.LeakyReLU", "nn.Tanh", "nn.Sigmoid", "nn.Softmax", "nn.Identity", "ValueError"] | 6 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.lvae_py.LadderVAE._init_multires", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.lvae_py.LadderVAE.create... | The function (get_activation) defined within the public class called public.The function start at line 11 and ends at 40. It contains 17 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It declares 8.0 functions, It has 8.0 functions called ... |
CAREamics_careamics | Conv_Block | public | 0 | 1 | __init__ | def __init__(self,conv_dim: int,in_channels: int,out_channels: int,intermediate_channel_multiplier: int = 1,stride: int = 1,padding: int = 1,bias: bool = True,groups: int = 1,activation: str = "ReLU",dropout_perc: float = 0,use_batch_norm: bool = False,) -> None:"""Constructor.Parameters----------conv_dim : intNumber o... | 3 | 46 | 12 | 237 | 0 | 50 | 126 | 50 | self,conv_dim,in_channels,out_channels,intermediate_channel_multiplier,stride,padding,bias,groups,activation,dropout_perc,use_batch_norm | [] | None | {"Assign": 7, "Expr": 2} | 9 | 77 | 9 | ["__init__", "super", "getattr", "getattr", "getattr", "getattr", "getattr", "getattr", "nn.Identity"] | 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 Conv_Block, that inherit another class.The function start at line 50 and ends at 126. It contains 46 lines of code and it has a cyclomatic complexity of 3. It takes 12 parameters, represented as [50.0] and does not return any value. It declares 9.0 function... |
CAREamics_careamics | Conv_Block | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> torch.Tensor:"""Forward pass.Parameters----------x : torch.TensorInput tensor.Returns-------torch.TensorOutput tensor."""if self.use_batch_norm:x = self.conv1(x)x = self.batch_norm1(x)x = self.activation(x)x = self.conv2(x)x = self.batch_norm2(x)x = self.activation(x)else:x = self.... | 3 | 16 | 2 | 121 | 0 | 128 | 156 | 128 | self,x | [] | torch.Tensor | {"Assign": 11, "Expr": 1, "If": 2, "Return": 1} | 11 | 29 | 11 | ["self.conv1", "self.batch_norm1", "self.activation", "self.conv2", "self.batch_norm2", "self.activation", "self.conv1", "self.activation", "self.conv2", "self.activation", "self.dropout"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called Conv_Block, that inherit another class.The function start at line 128 and ends at 156. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [128.0] and does not return any value. It declares 11.0 functio... |
CAREamics_careamics | public | public | 0 | 0 | _unpack_kernel_size | def _unpack_kernel_size(kernel_size: Union[tuple[int, ...], int], dim: int) -> tuple[int, ...]:"""Unpack kernel_size to a tuple of ints.Inspired by Kornia implementation. TODO: linkParameters----------kernel_size : Union[tuple[int, ...], int]Kernel size.dim : intNumber of dimensions.Returns-------tuple[int, ...]Kernel ... | 3 | 8 | 2 | 59 | 1 | 159 | 182 | 159 | kernel_size,dim | ['kernel_dims'] | tuple[int, ...] | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1} | 3 | 24 | 3 | ["isinstance", "tuple", "range"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py._compute_zero_padding", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py._get_pascal_kernel_nd"] | The function (_unpack_kernel_size) defined within the public class called public.The function start at line 159 and ends at 182. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [159.0] and does not return any value. It declares 3.0 functions, It has 3.0 functio... |
CAREamics_careamics | public | public | 0 | 0 | _compute_zero_padding | def _compute_zero_padding(kernel_size: Union[tuple[int, ...], int], dim: int) -> tuple[int, ...]:"""Utility function that computes zero padding tuple.Parameters----------kernel_size : Union[tuple[int, ...], int]Kernel size.dim : intNumber of dimensions.Returns-------tuple[int, ...]Zero padding tuple."""kernel_dims = _u... | 1 | 5 | 2 | 47 | 1 | 185 | 203 | 185 | kernel_size,dim | ['kernel_dims'] | tuple[int, ...] | {"Assign": 1, "Expr": 1, "Return": 1} | 2 | 19 | 2 | ["_unpack_kernel_size", "tuple"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py._max_blur_pool_by_kernel2d", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py._max_blur_pool_by_ke... | The function (_compute_zero_padding) defined within the public class called public.The function start at line 185 and ends at 203. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [185.0] and does not return any value. It declares 2.0 functions, It has 2.0 funct... |
CAREamics_careamics | public | public | 0 | 0 | get_pascal_kernel_1d | def get_pascal_kernel_1d(kernel_size: int,norm: bool = False,*,device: torch.device | None = None,dtype: torch.dtype | None = None,) -> torch.Tensor:"""Generate Yang Hui triangle (Pascal's triangle) for a given number.Inspired by Kornia implementation. TODO linkParameters----------kernel_size : intKernel size.norm : bo... | 5 | 21 | 4 | 157 | 4 | 206 | 265 | 206 | kernel_size,norm,device,dtype | ['value', 'pre', 'cur', 'out'] | torch.Tensor | {"AnnAssign": 2, "Assign": 7, "Expr": 1, "For": 2, "If": 2, "Return": 1} | 4 | 60 | 4 | ["range", "range", "torch.tensor", "out.sum"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py._get_pascal_kernel_nd"] | The function (get_pascal_kernel_1d) defined within the public class called public.The function start at line 206 and ends at 265. It contains 21 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [206.0] and does not return any value. It declares 4.0 functions, It has 4.0 funct... |
CAREamics_careamics | public | public | 0 | 0 | _get_pascal_kernel_nd | def _get_pascal_kernel_nd(kernel_size: Union[tuple[int, int], int],norm: bool = True,dim: int = 2,*,device: torch.device | None = None,dtype: torch.dtype | None = None,) -> torch.Tensor:"""Generate pascal filter kernel by kernel size.If kernel_size is an integer the kernel will be shaped as (kernel_size, kernel_size)ot... | 5 | 23 | 5 | 170 | 2 | 268 | 332 | 268 | kernel_size,norm,dim,device,dtype | ['kernel_dims', 'kernel'] | torch.Tensor | {"Assign": 5, "Expr": 1, "If": 3, "Return": 1} | 3 | 65 | 3 | ["_unpack_kernel_size", "get_pascal_kernel_1d", "torch.sum"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py.MaxBlurPool.__init__"] | The function (_get_pascal_kernel_nd) defined within the public class called public.The function start at line 268 and ends at 332. It contains 23 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [268.0] and does not return any value. It declares 3.0 functions, It has 3.0 func... |
CAREamics_careamics | public | public | 0 | 0 | _max_blur_pool_by_kernel2d | def _max_blur_pool_by_kernel2d(x: torch.Tensor,kernel: torch.Tensor,stride: int,max_pool_size: int,ceil_mode: bool,) -> torch.Tensor:"""Compute max_blur_pool by a given :math:`CxC_(out, None)xNxN` kernel.Inspired by Kornia implementation.Parameters----------x : torch.TensorInput tensor.kernel : torch.TensorKernel tenso... | 1 | 12 | 5 | 109 | 2 | 335 | 370 | 335 | x,kernel,stride,max_pool_size,ceil_mode | ['x', 'padding'] | torch.Tensor | {"Assign": 2, "Expr": 1, "Return": 1} | 4 | 36 | 4 | ["F.max_pool2d", "_compute_zero_padding", "F.conv2d", "x.size"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py.MaxBlurPool.forward"] | The function (_max_blur_pool_by_kernel2d) defined within the public class called public.The function start at line 335 and ends at 370. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [335.0] and does not return any value. It declares 4.0 functions, It has 4.0... |
CAREamics_careamics | public | public | 0 | 0 | _max_blur_pool_by_kernel3d | def _max_blur_pool_by_kernel3d(x: torch.Tensor,kernel: torch.Tensor,stride: int,max_pool_size: int,ceil_mode: bool,) -> torch.Tensor:"""Compute max_blur_pool by a given :math:`CxC_(out, None)xNxNxN` kernel.Inspired by Kornia implementation.Parameters----------x : torch.TensorInput tensor.kernel : torch.TensorKernel ten... | 1 | 14 | 5 | 117 | 2 | 373 | 410 | 373 | x,kernel,stride,max_pool_size,ceil_mode | ['x', 'padding'] | torch.Tensor | {"Assign": 2, "Expr": 1, "Return": 1} | 4 | 38 | 4 | ["F.max_pool3d", "_compute_zero_padding", "F.conv3d", "x.size"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.layers_py.MaxBlurPool.forward"] | The function (_max_blur_pool_by_kernel3d) defined within the public class called public.The function start at line 373 and ends at 410. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [373.0] and does not return any value. It declares 4.0 functions, It has 4.0... |
CAREamics_careamics | Conv_Block | public | 0 | 1 | __init__ | def __init__(self,dim: int,kernel_size: Union[tuple[int, int], int],stride: int = 2,max_pool_size: int = 2,ceil_mode: bool = False,) -> None:"""Constructor.Parameters----------dim : intDimension of the convolution.kernel_size : Union[tuple[int, int], int]Kernel size for max pooling.stride : int, optionalStride, by defa... | 1 | 16 | 6 | 105 | 0 | 433 | 463 | 433 | self,conv_dim,in_channels,out_channels,intermediate_channel_multiplier,stride,padding,bias,groups,activation,dropout_perc,use_batch_norm | [] | None | {"Assign": 7, "Expr": 2} | 9 | 77 | 9 | ["__init__", "super", "getattr", "getattr", "getattr", "getattr", "getattr", "getattr", "nn.Identity"] | 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 Conv_Block, that inherit another class.The function start at line 433 and ends at 463. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [433.0] and does not return any value. It declares 9.0 functio... |
CAREamics_careamics | Conv_Block | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> torch.Tensor:"""Forward pass of the function.Parameters----------x : torch.TensorInput tensor.Returns-------torch.TensorOutput tensor."""kernel = self.kernel.to(dtype=x.dtype)num_channels = int(x.size(1))if self.dim == 2:return _max_blur_pool_by_kernel2d(x,kernel.repeat((num_channe... | 2 | 19 | 2 | 118 | 0 | 465 | 495 | 465 | self,x | [] | torch.Tensor | {"Assign": 11, "Expr": 1, "If": 2, "Return": 1} | 11 | 29 | 11 | ["self.conv1", "self.batch_norm1", "self.activation", "self.conv2", "self.batch_norm2", "self.activation", "self.conv1", "self.activation", "self.conv2", "self.activation", "self.dropout"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called Conv_Block, that inherit another class.The function start at line 465 and ends at 495. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [465.0] and does not return any value. It declares 11.0 functio... |
CAREamics_careamics | public | public | 0 | 0 | model_factory | def model_factory(model_configuration: Union[UNetModel, LVAEModel],) -> torch.nn.Module:"""Deep learning model factory.Supported models are defined in careamics.config.SupportedArchitecture.Parameters----------model_configuration : Union[UNetModel, VAEModel]Model configuration.Returns-------torch.nn.ModuleModel class.R... | 3 | 11 | 1 | 66 | 0 | 24 | 54 | 24 | model_configuration | [] | torch.nn.Module | {"Expr": 1, "If": 2, "Return": 2} | 5 | 31 | 5 | ["UNet", "model_configuration.model_dump", "LVAE", "model_configuration.model_dump", "NotImplementedError"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.lightning_module_py.FCNModule.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.lightning_module_py.VA... | The function (model_factory) defined within the public class called public.The function start at line 24 and ends at 54. It contains 11 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 5.0 functions, It has 5.0 functions called i... |
CAREamics_careamics | UnetEncoder | public | 0 | 1 | __init__ | def __init__(self,conv_dim: int,in_channels: int = 1,depth: int = 3,num_channels_init: int = 64,use_batch_norm: bool = True,dropout: float = 0.0,pool_kernel: int = 2,n2v2: bool = False,groups: int = 1,) -> None:"""Constructor.Parameters----------conv_dim : intNumber of dimension of the convolution layers, 2 for 2D or 3... | 4 | 34 | 10 | 187 | 0 | 44 | 105 | 44 | self,conv_dim,in_channels,depth,num_channels_init,use_batch_norm,dropout,pool_kernel,n2v2,groups | [] | None | {"Assign": 5, "Expr": 4, "For": 1} | 9 | 62 | 9 | ["__init__", "super", "getattr", "MaxBlurPool", "range", "encoder_blocks.append", "Conv_Block", "encoder_blocks.append", "nn.ModuleList"] | 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 UnetEncoder, that inherit another class.The function start at line 44 and ends at 105. It contains 34 lines of code and it has a cyclomatic complexity of 4. It takes 10 parameters, represented as [44.0] and does not return any value. It declares 9.0 functio... |
CAREamics_careamics | UnetEncoder | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> list[torch.Tensor]:"""Forward pass.Parameters----------x : torch.TensorInput tensor.Returns-------list[torch.Tensor]Output of each encoder block (skip connections) and final output of theencoder."""encoder_features = []for module in self.encoder_blocks:x = module(x)if isinstance(mo... | 3 | 8 | 2 | 60 | 0 | 107 | 128 | 107 | self,x | [] | list[torch.Tensor] | {"Assign": 3, "Expr": 2, "For": 1, "If": 1, "Return": 1} | 3 | 22 | 3 | ["module", "isinstance", "encoder_features.append"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called UnetEncoder, that inherit another class.The function start at line 107 and ends at 128. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [107.0] and does not return any value. It declares 3.0 function... |
CAREamics_careamics | UnetEncoder | public | 0 | 1 | __init__ | def __init__(self,conv_dim: int,depth: int = 3,num_channels_init: int = 64,use_batch_norm: bool = True,dropout: float = 0.0,n2v2: bool = False,groups: int = 1,) -> None:"""Constructor.Parameters----------conv_dim : intNumber of dimension of the convolution layers, 2 for 2D or 3 for 3D.depth : int, optionalNumber of dec... | 6 | 46 | 8 | 261 | 0 | 154 | 232 | 154 | self,conv_dim,in_channels,depth,num_channels_init,use_batch_norm,dropout,pool_kernel,n2v2,groups | [] | None | {"Assign": 5, "Expr": 4, "For": 1} | 9 | 62 | 9 | ["__init__", "super", "getattr", "MaxBlurPool", "range", "encoder_blocks.append", "Conv_Block", "encoder_blocks.append", "nn.ModuleList"] | 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 UnetEncoder, that inherit another class.The function start at line 154 and ends at 232. It contains 46 lines of code and it has a cyclomatic complexity of 6. It takes 8 parameters, represented as [154.0] and does not return any value. It declares 9.0 functi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.