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
MultiChDloaderRef
public
0
0
replace_with_empty_patch
def replace_with_empty_patch(self, img_tuples):"""Replaces the content of one of the channels with background"""empty_index = self._empty_patch_fetcher.sample()empty_img_tuples, empty_img_noise_tuples = self._get_img(empty_index)assert (len(empty_img_noise_tuples) == 0), "Noise is not supported with empty patch replace...
3
13
2
85
0
584
599
584
self,img_tuples
[]
Returns
{"Assign": 3, "Expr": 3, "For": 1, "If": 1, "Return": 1}
8
16
8
["self._empty_patch_fetcher.sample", "self._get_img", "len", "range", "len", "final_img_tuples.append", "final_img_tuples.append", "tuple"]
0
[]
The function (replace_with_empty_patch) defined within the public class called MultiChDloaderRef.The function start at line 584 and ends at 599. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [584.0], and this function return a value. It declares 8.0 function...
CAREamics_careamics
MultiChDloaderRef
public
0
0
get_mean_std_for_input
def get_mean_std_for_input(self):mean, std = self.get_mean_std()return mean["input"], std["input"]
1
3
1
24
0
601
603
601
self
[]
Returns
{"Assign": 1, "Return": 1}
1
3
1
["self.get_mean_std"]
0
[]
The function (get_mean_std_for_input) defined within the public class called MultiChDloaderRef.The function start at line 601 and ends at 603. 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, and I...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_compute_target
def _compute_target(self, img_tuples, alpha):if self._tar_idx_list is not None and isinstance(self._tar_idx_list, int):target = img_tuples[self._tar_idx_list]else:if self._tar_idx_list is not None:assert isinstance(self._tar_idx_list, list) or isinstance(self._tar_idx_list, tuple)img_tuples = [img_tuples[i] for i in se...
6
11
3
90
0
605
616
605
self,img_tuples,alpha
[]
Returns
{"Assign": 3, "If": 2, "Return": 1}
4
12
4
["isinstance", "isinstance", "isinstance", "np.stack"]
0
[]
The function (_compute_target) defined within the public class called MultiChDloaderRef.The function start at line 605 and ends at 616. It contains 11 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [605.0], and this function return a value. It declares 4.0 functions, and I...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_compute_input_with_alpha
def _compute_input_with_alpha(self, img_tuples, alpha_list):# assert self._normalized_input is True, "normalization should happen here"if self._input_idx is not None:inp = img_tuples[self._input_idx]else:inp = 0for alpha, img in zip(alpha_list, img_tuples):inp += img * alphaif self._normalized_input is False:return inp...
6
24
3
166
0
618
646
618
self,img_tuples,alpha_list
[]
Returns
{"Assign": 8, "AugAssign": 1, "For": 2, "If": 3, "Return": 2}
10
29
10
["zip", "inp.astype", "self.get_mean_std_for_input", "mean.squeeze", "std.squeeze", "mean.reshape", "std.reshape", "range", "len", "inp.astype"]
0
[]
The function (_compute_input_with_alpha) defined within the public class called MultiChDloaderRef.The function start at line 618 and ends at 646. It contains 24 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [618.0], and this function return a value. It declares 10.0 functi...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_sample_alpha
def _sample_alpha(self):alpha_arr = []for i in range(self._num_channels):alpha_pos = np.random.rand()alpha = self._start_alpha_arr[i] + alpha_pos * (self._end_alpha_arr[i] - self._start_alpha_arr[i])alpha_arr.append(alpha)return alpha_arr
2
9
1
62
0
648
656
648
self
[]
Returns
{"Assign": 3, "Expr": 1, "For": 1, "Return": 1}
3
9
3
["range", "np.random.rand", "alpha_arr.append"]
0
[]
The function (_sample_alpha) defined within the public class called MultiChDloaderRef.The function start at line 648 and ends at 656. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_compute_input
def _compute_input(self, img_tuples):alpha = [1 / len(img_tuples) for _ in range(len(img_tuples))]if self._start_alpha_arr is not None:alpha = self._sample_alpha()inp = self._compute_input_with_alpha(img_tuples, alpha)if self._input_is_sum:inp = len(img_tuples) * inp# TODO instead we add channel hereif len(inp.shape) =...
7
10
2
102
0
658
671
658
self,img_tuples
[]
Returns
{"Assign": 5, "If": 3, "Return": 1}
8
14
8
["len", "range", "len", "self._sample_alpha", "self._compute_input_with_alpha", "len", "len", "len"]
0
[]
The function (_compute_input) defined within the public class called MultiChDloaderRef.The function start at line 658 and ends at 671. It contains 10 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [658.0], and this function return a value. It declares 8.0 functions, and It...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_get_index_from_valid_target_logic
def _get_index_from_valid_target_logic(self, index):if self._validtarget_rand_fract is not None:if np.random.rand() < self._validtarget_rand_fract:index = self._train_index_switcher.get_valid_target_index()else:index = self._train_index_switcher.get_invalid_target_index()return index
3
7
2
50
0
673
679
673
self,index
[]
Returns
{"Assign": 2, "If": 2, "Return": 1}
3
7
3
["np.random.rand", "self._train_index_switcher.get_valid_target_index", "self._train_index_switcher.get_invalid_target_index"]
0
[]
The function (_get_index_from_valid_target_logic) defined within the public class called MultiChDloaderRef.The function start at line 673 and ends at 679. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [673.0], and this function return a value. It declares 3.0...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_rotate2D
def _rotate2D(self, img_tuples):img_kwargs = {}for i, img in enumerate(img_tuples):for k in range(len(img)):img_kwargs[f"img{i}_{k}"] = img[k]keys = list(img_kwargs.keys())self._rotation_transform.add_targets({k: "image" for k in keys})rot_dic = self._rotation_transform(image=img_tuples[0][0], **img_kwargs)rotated_img_...
7
19
2
160
0
681
702
681
self,img_tuples
[]
Returns
{"Assign": 5, "Expr": 3, "For": 3, "If": 1, "Return": 1}
14
22
14
["enumerate", "range", "len", "list", "img_kwargs.keys", "self._rotation_transform.add_targets", "self._rotation_transform", "enumerate", "len", "rotated_img_tuples.append", "rotated_img_tuples.append", "np.concatenate", "range", "len"]
0
[]
The function (_rotate2D) defined within the public class called MultiChDloaderRef.The function start at line 681 and ends at 702. It contains 19 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [681.0], and this function return a value. It declares 14.0 functions, and It has...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_rotate3D
def _rotate3D(self, img_tuples):img_kwargs = {}# random flip in z directionflip_z = self._flipz_3D and np.random.rand() < 0.5for i, img in enumerate(img_tuples):for j in range(self._depth3D):for k in range(len(img)):if flip_z:z_idx = self._depth3D - 1 - jelse:z_idx = jimg_kwargs[f"img{i}_{z_idx}_{k}"] = img[k, j]keys =...
12
40
2
264
0
704
746
704
self,img_tuples
[]
Returns
{"Assign": 9, "Expr": 4, "For": 5, "If": 2, "Return": 1}
21
43
21
["np.random.rand", "enumerate", "range", "range", "len", "list", "img_kwargs.keys", "self._rotation_transform.add_targets", "self._rotation_transform", "enumerate", "len", "rotated_img_tuples.append", "np.concatenate", "range", "range", "len", "temp_arr.append", "np.concatenate", "range", "rotated_img_tuples.append", "...
0
[]
The function (_rotate3D) defined within the public class called MultiChDloaderRef.The function start at line 704 and ends at 746. It contains 40 lines of code and it has a cyclomatic complexity of 12. It takes 2 parameters, represented as [704.0], and this function return a value. It declares 21.0 functions, and It ha...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_rotate
def _rotate(self, img_tuples, noise_tuples):if self._3Ddata:return self._rotate3D(img_tuples, noise_tuples)else:return self._rotate2D(img_tuples, noise_tuples)
2
5
3
34
0
748
753
748
self,img_tuples,noise_tuples
[]
Returns
{"If": 1, "Return": 2}
2
6
2
["self._rotate3D", "self._rotate2D"]
0
[]
The function (_rotate) defined within the public class called MultiChDloaderRef.The function start at line 748 and ends at 753. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [748.0], and this function return a value. It declares 2.0 functions, and It has 2.0...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_get_img
def _get_img(self, ch_idx: int, patch_idx: int):"""Loads an image.Crops the image such that cropped image has content."""img = self._load_img(ch_idx, patch_idx)cropped_img = self._crop_imgs(ch_idx, patch_idx, img)return cropped_img
1
4
3
38
0
755
762
755
self,ch_idx,patch_idx
[]
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
2
8
2
["self._load_img", "self._crop_imgs"]
0
[]
The function (_get_img) defined within the public class called MultiChDloaderRef.The function start at line 755 and ends at 762. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [755.0], and this function return a value. It declares 2.0 functions, and It has 2....
CAREamics_careamics
MultiChDloaderRef
public
0
0
get_uncorrelated_img_tuples
def get_uncorrelated_img_tuples(self, index):"""Content of channels like actin and nuclei is "correlated" in itsrespective location, this function allows to pick channels' contentfrom different patches of the image to make it "uncorrelated"."""img_tuples = []for ch_idx in range(len(self._data)):if ch_idx == 0:# dataset...
3
11
2
82
0
764
782
764
self,index
[]
Returns
{"Assign": 2, "Expr": 3, "For": 1, "If": 1, "Return": 1}
8
19
8
["range", "len", "img_tuples.append", "self._get_img", "np.random.randint", "self.idx_manager.total_grid_count", "img_tuples.append", "self._get_img"]
0
[]
The function (get_uncorrelated_img_tuples) defined within the public class called MultiChDloaderRef.The function start at line 764 and ends at 782. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [764.0], and this function return a value. It declares 8.0 funct...
CAREamics_careamics
MultiChDloaderRef
public
0
0
__getitem__
def __getitem__(self, index: Union[int, tuple[int, int]]) -> tuple[np.ndarray, np.ndarray]:# Uncorrelated channels means crops to create the input are taken from different# spatial locations of the image.if (self._uncorrelated_channelsand np.random.rand() < self._uncorrelated_channel_probab):input_tuples = self.get_unc...
4
16
2
117
0
784
810
784
self,index
[]
tuple[np.ndarray, np.ndarray]
{"Assign": 6, "If": 2, "Return": 1}
7
27
7
["np.random.rand", "self.get_uncorrelated_img_tuples", "self._get_img", "self._rotate", "self._compute_input", "self._compute_target", "self.normalize_target"]
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 MultiChDloaderRef.The function start at line 784 and ends at 810. It contains 16 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [784.0] and does not return any value. It declares 7.0 functions, It has 7.0 fun...
CAREamics_careamics
MultiChDloaderRef
public
0
0
__init__
def __init__(self,data_config: MicroSplitDataConfig,fpath: str,load_data_fn: Callable,val_fraction=None,test_fraction=None,):self._padding_kwargs = (data_config.padding_kwargs# mode=padding_mode, constant_values=constant_value)self._uncorrelated_channel_probab = data_config.uncorrelated_channel_probabsuper().__init__(d...
5
53
6
323
0
814
875
814
self,data_config,fpath,load_data_fn,val_fraction,test_fraction
[]
None
{"Assign": 45, "Expr": 5, "If": 5, "Try": 1}
10
128
10
["Path", "self.load_data", "self.get_data_shapes", "print", "self.set_img_sz", "EmptyPatchFetcher", "self.rm_bkground_set_max_val_and_upperclip_data", "A.Compose", "A.Flip", "A.RandomRotate90"]
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 MultiChDloaderRef.The function start at line 814 and ends at 875. It contains 53 lines of code and it has a cyclomatic complexity of 5. It takes 6 parameters, represented as [814.0] and does not return any value. It declares 10.0 functions, It has 10.0 func...
CAREamics_careamics
MultiChDloaderRef
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 t_list is not Noneassert h_start is Noneassert h_end is Noneassert w_start is Noneassert w_end is Noneself._data = self._data[t_list].copy()self._scaled_data = [self._scaled_data[i][t_list].copy() for i in range(len(self._scal...
4
23
6
175
0
877
903
877
self,t_list,z_start,z_end,h_start,h_end,w_start,w_end
[]
None
{}
1
11
1
["NotImplementedError"]
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 MultiChDloaderRef.The function start at line 877 and ends at 903. It contains 23 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [877.0] and does not return any value. It declare 1.0 function, It has 1.0 funct...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_init_msg
def _init_msg(self):msg = super()._init_msg()msg += f" Pad:{self._padding_kwargs}"if self._uncorrelated_channels:msg += f" UncorrChProbab:{self._uncorrelated_channel_probab}"return msg
2
6
1
29
0
905
910
905
self
[]
Returns
{"Assign": 3, "AugAssign": 13, "If": 7, "Return": 1}
7
38
7
["int", "self.idx_manager.get_individual_dim_grid_count", "range", "len", "join", "str", "self.idx_manager.total_grid_count"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.lc_dataset_py.LCMultiChDloader._init_msg", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.data...
The function (_init_msg) defined within the public class called MultiChDloaderRef.The function start at line 905 and ends at 910. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 7.0 functions, It has 7.0 functi...
CAREamics_careamics
LCMultiChDloaderRef
public
0
1
_load_scaled_img
def _load_scaled_img(self, scaled_index, index: Union[int, tuple[int, int]]) -> tuple[np.ndarray, np.ndarray]:if isinstance(index, int):idx = indexelse:idx, _ = index# tidx = self.idx_manager.get_t(idx)patch_loc_list = self.idx_manager.get_patch_location_from_dataset_idx(idx)nidx = patch_loc_list[0]imgs = self._scaled_...
7
17
3
189
0
912
931
912
self,scaled_index,index
[]
tuple[np.ndarray, np.ndarray]
{"Assign": 10, "If": 2, "Return": 1}
8
20
8
["isinstance", "self.idx_manager.get_patch_location_from_dataset_idx", "tuple", "range", "tuple", "range", "np.sqrt", "tuple"]
0
[]
The function (_load_scaled_img) defined within the public class called LCMultiChDloaderRef, that inherit another class.The function start at line 912 and ends at 931. It contains 17 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [912.0] and does not return any value. It dec...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_crop_img
def _crop_img(self, img: np.ndarray, patch_start_loc: tuple):"""Here, h_start, w_start could be negative. That simply means we need to pick the content from 0. So,the cropped image will be smaller than self._img_sz * self._img_sz"""max_len_vals = list(self.idx_manager.data_shape[1:-1])max_len_vals[-2:] = img.shape[-2:]...
1
6
3
60
0
933
942
933
self,img,patch_start_loc
[]
Returns
{"Assign": 7, "If": 2, "Return": 2}
2
23
2
["np.array", "self._crop_img_with_padding"]
0
[]
The function (_crop_img) defined within the public class called MultiChDloaderRef.The function start at line 933 and ends at 942. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [933.0], and this function return a value. It declares 2.0 functions, and It has 2...
CAREamics_careamics
MultiChDloaderRef
public
0
0
_get_img
def _get_img(self, index: int):"""Returns the primary patch along with low resolution patches centered on the primary patch."""# Noise_tuples is populated when there is synthetic noise in training# Should have similar type of noise with the noise model# Starting with microsplit, dump the noise, use it instead as an aug...
10
47
2
330
0
944
1,002
944
self,ch_idx,patch_idx
[]
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
2
8
2
["self._load_img", "self._crop_imgs"]
0
[]
The function (_get_img) defined within the public class called MultiChDloaderRef.The function start at line 944 and ends at 1002. It contains 47 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [944.0], and this function return a value. It declares 2.0 functions, and It has...
CAREamics_careamics
MultiChDloaderRef
public
0
0
__getitem__
def __getitem__(self, index: Union[int, tuple[int, int]]):img_tuples, noise_tuples = self._get_img(index)if self._uncorrelated_channels:assert (self._input_idx is None), "Uncorrelated channels is not implemented when there is a separate input channel."if np.random.rand() < self._uncorrelated_channel_probab:img_tuples_n...
16
47
2
359
0
1,004
1,067
1,004
self,index
[]
tuple[np.ndarray, np.ndarray]
{"Assign": 6, "If": 2, "Return": 1}
7
27
7
["np.random.rand", "self.get_uncorrelated_img_tuples", "self._get_img", "self._rotate", "self._compute_input", "self._compute_target", "self.normalize_target"]
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 MultiChDloaderRef.The function start at line 1004 and ends at 1067. It contains 47 lines of code and it has a cyclomatic complexity of 16. It takes 2 parameters, represented as [1004.0] and does not return any value. It declares 7.0 functions, It has 7.0...
CAREamics_careamics
MultiChDloader
public
0
1
__init__
def __init__(self,data_config: MicroSplitDataConfig,datapath: Union[str, Path],load_data_fn: Optional[Callable] = None,val_fraction: float = 0.1,test_fraction: float = 0.1,allow_generation: bool = False,):""" """self._data_type = data_config.data_typeself._fpath = datapathself._data = self._noise_data = Noneself.Z = 1s...
16
117
7
670
0
22
175
22
self,data_config,datapath,load_data_fn,val_fraction,test_fraction,allow_generation
[]
None
{"Assign": 55, "Expr": 6, "If": 8, "Try": 1}
10
154
10
["self.load_data", "print", "self.set_img_sz", "IndexSwitcher", "self.set_img_sz", "EmptyPatchFetcher", "self.rm_bkground_set_max_val_and_upperclip_data", "A.Compose", "A.Flip", "A.RandomRotate90"]
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 MultiChDloader, that inherit another class.The function start at line 22 and ends at 175. It contains 117 lines of code and it has a cyclomatic complexity of 16. It takes 7 parameters, represented as [22.0] and does not return any value. It declares 10.0 fu...
CAREamics_careamics
MultiChDloader
public
0
1
disable_noise
def disable_noise(self):assert (self._poisson_noise_factor is None), "This is not supported. Poisson noise is added to the data itself and so the noise cannot be disabled."self._disable_noise = True
1
5
1
20
0
182
186
182
self
[]
None
{"Assign": 1}
0
5
0
[]
0
[]
The function (disable_noise) defined within the public class called MultiChDloader, that inherit another class.The function start at line 182 and ends at 186. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
CAREamics_careamics
MultiChDloader
public
0
1
enable_noise
def enable_noise(self):self._disable_noise = False
1
2
1
10
0
188
189
188
self
[]
None
{"Assign": 1}
0
2
0
[]
0
[]
The function (enable_noise) defined within the public class called MultiChDloader, that inherit another class.The function start at line 188 and ends at 189. 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..
CAREamics_careamics
MultiChDloader
public
0
1
get_data_shape
def get_data_shape(self):return self._data.shape
1
2
1
11
0
191
192
191
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (get_data_shape) defined within the public class called MultiChDloader, that inherit another class.The function start at line 191 and ends at 192. 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
MultiChDloader
public
0
1
load_data
def load_data(self,data_config,datasplit_type,load_data_fn: Callable,val_fraction=None,test_fraction=None,allow_generation=None,):self._data = load_data_fn(data_config,self._fpath,datasplit_type,val_fraction=val_fraction,test_fraction=test_fraction,allow_generation=allow_generation,)self._loaded_data_preprocessing(data...
1
18
7
59
0
194
211
194
self,data_config,datasplit_type,load_data_fn,val_fraction,test_fraction,allow_generation
[]
None
{"Assign": 1, "Expr": 1}
2
18
2
["load_data_fn", "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 MultiChDloader, that inherit another class.The function start at line 194 and ends at 211. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [194.0] and does not return any value. It declares 2.0 fu...
CAREamics_careamics
MultiChDloader
public
0
1
_loaded_data_preprocessing
def _loaded_data_preprocessing(self, data_config):old_shape = self._data.shapeif self._datausage_fraction < 1.0:framepixelcount = np.prod(self._data.shape[1:3])pixelcount = int(len(self._data) * framepixelcount * self._datausage_fraction)frame_count = int(np.ceil(pixelcount / framepixelcount))last_frame_reduced_size, _...
10
48
2
373
0
213
267
213
self,data_config
[]
None
{"Assign": 17, "AugAssign": 3, "Expr": 2, "If": 9}
15
55
15
["np.prod", "int", "len", "int", "np.ceil", "IndexSwitcher.get_reduced_frame_size", "copy", "copy", "print", "np.random.poisson", "np.random.normal", "np.mean", "print", "len", "self._data.reshape"]
0
[]
The function (_loaded_data_preprocessing) defined within the public class called MultiChDloader, that inherit another class.The function start at line 213 and ends at 267. It contains 48 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [213.0] and does not return any value. ...
CAREamics_careamics
MultiChDloader
public
0
1
save_background
def save_background(self, channel_idx, frame_idx, background_value):self._background_values[frame_idx, channel_idx] = background_value
1
2
4
21
0
269
270
269
self,channel_idx,frame_idx,background_value
[]
None
{"Assign": 1}
0
2
0
[]
0
[]
The function (save_background) defined within the public class called MultiChDloader, that inherit another class.The function start at line 269 and ends at 270. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [269.0] and does not return any value..
CAREamics_careamics
MultiChDloader
public
0
1
get_background
def get_background(self, channel_idx, frame_idx):return self._background_values[frame_idx, channel_idx]
1
2
3
18
0
272
273
272
self,channel_idx,frame_idx
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (get_background) defined within the public class called MultiChDloader, that inherit another class.The function start at line 272 and ends at 273. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [272.0], and this function return a value..
CAREamics_careamics
MultiChDloader
public
0
1
remove_background
def remove_background(self):self._background_values = np.zeros((self._data.shape[0], self._data.shape[-1]))if self._background_quantile == 0.0:assert (self._clip_background_noise_to_zero is False), "This operation currently happens later in this function."returnif self._data.dtype in [np.uint16]:# unsigned integer crea...
6
20
1
191
0
275
301
275
self
[]
None
{"Assign": 5, "AugAssign": 1, "Expr": 1, "For": 2, "If": 3, "Return": 1}
8
27
8
["np.zeros", "self._data.astype", "range", "range", "np.quantile", "np.abs", "int", "self.save_background"]
0
[]
The function (remove_background) defined within the public class called MultiChDloader, that inherit another class.The function start at line 275 and ends at 301. It contains 20 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 8....
CAREamics_careamics
MultiChDloader
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.remove_background()self.set_max_val(max_val, datasplit_type)self.upperclip_data()
1
4
3
27
0
303
306
303
self,max_val,datasplit_type
[]
None
{"Expr": 3}
3
4
3
["self.remove_background", "self.set_max_val", "self.upperclip_data"]
0
[]
The function (rm_bkground_set_max_val_and_upperclip_data) defined within the public class called MultiChDloader, that inherit another class.The function start at line 303 and ends at 306. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [303.0] and does not retu...
CAREamics_careamics
MultiChDloader
public
0
1
upperclip_data
def upperclip_data(self):if isinstance(self.max_val, list):chN = self._data.shape[-1]assert chN == len(self.max_val)for ch in range(chN):ch_data = self._data[..., ch]ch_q = self.max_val[ch]ch_data[ch_data > ch_q] = ch_qself._data[..., ch] = ch_dataelse:self._data[self._data > self.max_val] = self.max_val
3
11
1
97
0
308
318
308
self
[]
None
{"Assign": 6, "For": 1, "If": 1}
3
11
3
["isinstance", "len", "range"]
0
[]
The function (upperclip_data) defined within the public class called MultiChDloader, that inherit another class.The function start at line 308 and ends at 318. 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 3.0 f...
CAREamics_careamics
MultiChDloader
public
0
1
compute_max_val
def compute_max_val(self):if self._channelwise_quantile:max_val_arr = [np.quantile(self._data[..., i], self._quantile)for i in range(self._data.shape[-1])]return max_val_arrelse:return np.quantile(self._data, self._quantile)
3
9
1
63
0
320
328
320
self
[]
Returns
{"Assign": 1, "If": 1, "Return": 2}
3
9
3
["np.quantile", "range", "np.quantile"]
0
[]
The function (compute_max_val) defined within the public class called MultiChDloader, that inherit another class.The function start at line 320 and ends at 328. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 3...
CAREamics_careamics
MultiChDloader
public
0
1
set_max_val
def set_max_val(self, max_val, datasplit_type):if max_val is None:assert datasplit_type == DataSplitType.Trainself.max_val = self.compute_max_val()else:assert max_val is not Noneself.max_val = max_val
2
7
3
41
0
330
337
330
self,max_val,datasplit_type
[]
None
{"Assign": 2, "If": 1}
1
8
1
["self.compute_max_val"]
0
[]
The function (set_max_val) defined within the public class called MultiChDloader, that inherit another class.The function start at line 330 and ends at 337. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [330.0] and does not return any value. It declare 1.0 fu...
CAREamics_careamics
MultiChDloader
public
0
1
get_max_val
def get_max_val(self):return self.max_val
1
2
1
9
0
339
340
339
self
[]
Returns
{"Return": 1}
0
2
0
[]
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 MultiChDloader, that inherit another class.The function start at line 339 and ends at 340. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 1.0 functi...
CAREamics_careamics
MultiChDloader
public
0
1
get_img_sz
def get_img_sz(self):return self._img_sz
1
2
1
9
0
342
343
342
self
[]
Returns
{"Return": 1}
0
2
0
[]
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 MultiChDloader, that inherit another class.The function start at line 342 and ends at 343. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 1.0 functio...
CAREamics_careamics
MultiChDloader
public
0
1
get_num_frames
def get_num_frames(self):return self._data.shape[0]
1
2
1
14
0
345
346
345
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (get_num_frames) defined within the public class called MultiChDloader, that inherit another class.The function start at line 345 and ends at 346. 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
MultiChDloader
public
0
1
reduce_data
def reduce_data(self,t_list=None,z_start=None,z_end=None,h_start=None,h_end=None,w_start=None,w_end=None,):if self._5Ddata:if t_list is None:t_list = list(range(self._data.shape[0]))if z_start is None:z_start = 0if z_end is None:z_end = self._data.shape[1]if h_start is None:h_start = 0if h_end is None:h_end = self._dat...
16
52
8
341
0
348
401
348
self,t_list,z_start,z_end,h_start,h_end,w_start,w_end
[]
None
{"Assign": 16, "Expr": 2, "If": 15}
10
54
10
["list", "range", "copy", "copy", "list", "range", "copy", "copy", "self.set_img_sz", "print"]
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 MultiChDloader, that inherit another class.The function start at line 348 and ends at 401. It contains 52 lines of code and it has a cyclomatic complexity of 16. It takes 8 parameters, represented as [348.0] and does not return any value. It declares 10....
CAREamics_careamics
MultiChDloader
public
0
1
get_idx_manager_shapes
def get_idx_manager_shapes(self, patch_size: int, grid_size: Union[int, tuple[int, int, int]]):numC = self._data.shape[-1]if self._5Ddata:patch_shape = (1, self._depth3D, patch_size, patch_size, numC)if isinstance(grid_size, int):grid_shape = (1, 1, grid_size, grid_size, numC)else:assert len(grid_size) == 3assert all([...
4
19
3
172
0
403
422
403
self,patch_size,grid_size
[]
Returns
{"Assign": 6, "If": 2, "Return": 1}
5
20
5
["isinstance", "len", "all", "zip", "isinstance"]
0
[]
The function (get_idx_manager_shapes) defined within the public class called MultiChDloader, that inherit another class.The function start at line 403 and ends at 422. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [403.0], and this function return a value. I...
CAREamics_careamics
MultiChDloader
public
0
1
set_img_sz
def set_img_sz(self, image_size, grid_size: Union[int, tuple[int, int, int]]):"""If one wants to change the image size on the go, then this can be used.Args:image_size: size of one patchgrid_size: frame is divided into square grids of this size. A patch centered on a grid having size `image_size` is returned."""# hacky...
1
10
3
77
0
424
441
424
self,image_size,grid_size
[]
None
{"Assign": 5, "Expr": 1}
2
18
2
["self.get_idx_manager_shapes", "GridIndexManager"]
0
[]
The function (set_img_sz) defined within the public class called MultiChDloader, that inherit another class.The function start at line 424 and ends at 441. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [424.0] and does not return any value. It declares 2.0 f...
CAREamics_careamics
MultiChDloader
public
0
1
__len__
def __len__(self):# Vera: N is the number of frames in Z stack# Repeat factor is n_rows * n_colsreturn self.idx_manager.total_grid_count()
1
2
1
13
0
444
447
444
self
[]
Returns
{"Return": 1}
1
4
1
["self.idx_manager.total_grid_count"]
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 MultiChDloader, that inherit another class.The function start at line 444 and ends at 447. 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 functi...
CAREamics_careamics
MultiChDloader
public
0
1
set_repeat_factor
def set_repeat_factor(self):if self._grid_sz > 1:self._repeat_factor = self.idx_manager.grid_rows(self._grid_sz) * self.idx_manager.grid_cols(self._grid_sz)else:self._repeat_factor = self.idx_manager.grid_rows(self._img_sz) * self.idx_manager.grid_cols(self._img_sz)
2
9
1
64
0
449
457
449
self
[]
None
{"Assign": 2, "If": 1}
4
9
4
["self.idx_manager.grid_rows", "self.idx_manager.grid_cols", "self.idx_manager.grid_rows", "self.idx_manager.grid_cols"]
0
[]
The function (set_repeat_factor) defined within the public class called MultiChDloader, that inherit another class.The function start at line 449 and ends at 457. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0...
CAREamics_careamics
MultiChDloader
public
0
1
_init_msg
def _init_msg(self,):msg = (f"[{self.__class__.__name__}] Train:{int(self._is_train)} Sz:{self._img_sz}")dim_sizes = [self.idx_manager.get_individual_dim_grid_count(dim)for dim in range(len(self._data.shape))]dim_sizes = ",".join([str(x) for x in dim_sizes])msg += f" N:{self.N} NumPatchPerN:{self._repeat_factor}"msg +=...
10
32
1
151
0
459
496
459
self
[]
Returns
{"Assign": 3, "AugAssign": 13, "If": 7, "Return": 1}
7
38
7
["int", "self.idx_manager.get_individual_dim_grid_count", "range", "len", "join", "str", "self.idx_manager.total_grid_count"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.dataset.lc_dataset_py.LCMultiChDloader._init_msg", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.data...
The function (_init_msg) defined within the public class called MultiChDloader, that inherit another class.The function start at line 459 and ends at 496. It contains 32 lines of code and it has a cyclomatic complexity of 10. The function does not take any parameters, and this function return a value. It declares 7.0 f...
CAREamics_careamics
MultiChDloader
public
0
1
_crop_imgs
def _crop_imgs(self, index, *img_tuples: np.ndarray):h, w = img_tuples[0].shape[-2:]if self._img_sz is None:return (*img_tuples,{"h": [0, h], "w": [0, w], "hflip": False, "wflip": False},)if self._enable_random_cropping:patch_start_loc = self._get_random_hw(h, w)if self._5Ddata:patch_start_loc = (np.random.choice(1 + i...
5
26
3
177
0
498
526
498
self,index,*img_tuples
[]
Returns
{"Assign": 6, "Expr": 1, "For": 1, "If": 3, "Return": 2}
6
29
6
["self._get_random_hw", "np.random.choice", "self._get_deterministic_loc", "self._crop_flip_img", "cropped_imgs.append", "tuple"]
0
[]
The function (_crop_imgs) defined within the public class called MultiChDloader, that inherit another class.The function start at line 498 and ends at 526. It contains 26 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [498.0], and this function return a value. It declares 6...
CAREamics_careamics
MultiChDloader
public
0
1
_crop_img
def _crop_img(self, img: np.ndarray, patch_start_loc: tuple):if self._tiling_mode in [TilingMode.TrimBoundary, TilingMode.ShiftBoundary]:# In training, this is used.# NOTE: It is my opinion that if I just use self._crop_img_with_padding, it will work perfectly fine.# The only benefit this if else loop provides is that ...
3
17
3
134
0
528
550
528
self,img,patch_start_loc
[]
Returns
{"Assign": 7, "If": 2, "Return": 2}
2
23
2
["np.array", "self._crop_img_with_padding"]
0
[]
The function (_crop_img) defined within the public class called MultiChDloader, that inherit another class.The function start at line 528 and ends at 550. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [528.0], and this function return a value. It declares 2....
CAREamics_careamics
MultiChDloader
public
0
1
get_begin_end_padding
def get_begin_end_padding(self, start_pos, end_pos, max_len):"""The effect is that the image with size self._grid_sz is in the center of the patch with sufficientpadding on all four sides so that the final patch size is self._img_sz."""pad_start = 0pad_end = 0if start_pos < 0:pad_start = -1 * start_pospad_end = max(0, ...
2
7
4
43
0
552
564
552
self,start_pos,end_pos,max_len
[]
Returns
{"Assign": 4, "Expr": 1, "If": 1, "Return": 1}
1
13
1
["max"]
0
[]
The function (get_begin_end_padding) defined within the public class called MultiChDloader, that inherit another class.The function start at line 552 and ends at 564. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [552.0], and this function return a value. It ...
CAREamics_careamics
MultiChDloader
public
0
1
_crop_img_with_padding
def _crop_img_with_padding(self, img: np.ndarray, patch_start_loc, max_len_vals=None):if max_len_vals is None:max_len_vals = self.idx_manager.data_shape[1:-1]patch_end_loc = np.array(patch_start_loc, dtype=int) + np.array(self.idx_manager.patch_shape[1:-1], dtype=int)boundary_crossed = []valid_slice = []padding = [[0, ...
7
36
4
294
0
566
606
566
self,img,patch_start_loc,max_len_vals
[]
Returns
{"Assign": 10, "Expr": 3, "For": 1, "If": 4, "Return": 1}
11
41
11
["np.array", "np.array", "zip", "boundary_crossed.append", "valid_slice.append", "max", "min", "self.get_begin_end_padding", "padding.append", "np.all", "np.pad"]
0
[]
The function (_crop_img_with_padding) defined within the public class called MultiChDloader, that inherit another class.The function start at line 566 and ends at 606. It contains 36 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [566.0], and this function return a value. I...
CAREamics_careamics
MultiChDloader
public
0
1
_crop_flip_img
def _crop_flip_img(self, img: np.ndarray, patch_start_loc: tuple, h_flip: bool, w_flip: bool):new_img = self._crop_img(img, patch_start_loc)if h_flip:new_img = new_img[..., ::-1, :]if w_flip:new_img = new_img[..., :, ::-1]return new_img.astype(np.float32)
3
9
5
72
0
608
617
608
self,img,patch_start_loc,h_flip,w_flip
[]
Returns
{"Assign": 3, "If": 2, "Return": 1}
2
10
2
["self._crop_img", "new_img.astype"]
0
[]
The function (_crop_flip_img) defined within the public class called MultiChDloader, that inherit another class.The function start at line 608 and ends at 617. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [608.0], and this function return a value. It declare...
CAREamics_careamics
MultiChDloader
public
0
1
_load_img
def _load_img(self, index: Union[int, tuple[int, int]]) -> tuple[np.ndarray, np.ndarray]:"""Returns the channels and also the respective noise channels."""if isinstance(index, int) or isinstance(index, np.int64):idx = indexelse:idx = index[0]patch_loc_list = self.idx_manager.get_patch_location_from_dataset_idx(idx)imgs...
7
17
2
167
0
619
647
619
self,index
[]
tuple[np.ndarray, np.ndarray]
{"Assign": 7, "Expr": 1, "If": 2, "Return": 1}
7
29
7
["isinstance", "isinstance", "self.idx_manager.get_patch_location_from_dataset_idx", "range", "range", "tuple", "tuple"]
0
[]
The function (_load_img) defined within the public class called MultiChDloader, that inherit another class.The function start at line 619 and ends at 647. It contains 17 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [619.0] and does not return any value. It declares 7.0 fu...
CAREamics_careamics
MultiChDloader
public
0
1
get_mean_std
def get_mean_std(self):return self._mean, self._std
1
2
1
13
0
649
650
649
self
[]
Returns
{"Return": 1}
0
2
0
[]
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 MultiChDloader, that inherit another class.The function start at line 649 and ends at 650. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 1.0 funct...
CAREamics_careamics
MultiChDloader
public
0
1
set_mean_std
def set_mean_std(self, mean_val, std_val):self._mean = mean_valself._std = std_val
1
3
3
19
0
652
654
652
self,mean_val,std_val
[]
None
{"Assign": 2}
0
3
0
[]
0
[]
The function (set_mean_std) defined within the public class called MultiChDloader, that inherit another class.The function start at line 652 and ends at 654. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [652.0] and does not return any value..
CAREamics_careamics
MultiChDloader
public
0
1
normalize_img
def normalize_img(self, *img_tuples):mean, std = self.get_mean_std()mean = mean["target"]std = std["target"]mean = mean.squeeze()std = std.squeeze()normalized_imgs = []for i, img in enumerate(img_tuples):img = (img - mean[i]) / std[i]normalized_imgs.append(img)return tuple(normalized_imgs)
2
11
2
83
0
656
666
656
self,*img_tuples
[]
Returns
{"Assign": 7, "Expr": 1, "For": 1, "Return": 1}
6
11
6
["self.get_mean_std", "mean.squeeze", "std.squeeze", "enumerate", "normalized_imgs.append", "tuple"]
0
[]
The function (normalize_img) defined within the public class called MultiChDloader, that inherit another class.The function start at line 656 and ends at 666. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [656.0], and this function return a value. It declare...
CAREamics_careamics
MultiChDloader
public
0
1
normalize_input
def normalize_input(self, x):mean_dict, std_dict = self.get_mean_std()mean_ = mean_dict["input"].mean()std_ = std_dict["input"].mean()return (x - mean_) / std_
1
5
2
44
0
668
672
668
self,x
[]
Returns
{"Assign": 3, "Return": 1}
3
5
3
["self.get_mean_std", "mean", "mean"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3719451_ethereum_pyrlp.tests.core.test_json_py.normalize_input", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70555013_embeddings_benchmark_mteb.mteb.models.jina_models_py.JinaV4Wrapper.score_single_vector", "_.con...
The function (normalize_input) defined within the public class called MultiChDloader, that inherit another class.The function start at line 668 and ends at 672. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [668.0], and this function return a value. It declar...
CAREamics_careamics
MultiChDloader
public
0
1
normalize_target
def normalize_target(self, target):mean_dict, std_dict = self.get_mean_std()mean_ = mean_dict["target"].squeeze(0)std_ = std_dict["target"].squeeze(0)return (target - mean_) / std_
1
5
2
46
0
674
678
674
self,target
[]
Returns
{"Assign": 3, "Return": 1}
3
5
3
["self.get_mean_std", "squeeze", "squeeze"]
0
[]
The function (normalize_target) defined within the public class called MultiChDloader, that inherit another class.The function start at line 674 and ends at 678. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [674.0], and this function return a value. It decla...
CAREamics_careamics
MultiChDloader
public
0
1
get_grid_size
def get_grid_size(self):return self._grid_sz
1
2
1
9
0
680
681
680
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (get_grid_size) defined within the public class called MultiChDloader, that inherit another class.The function start at line 680 and ends at 681. 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
MultiChDloader
public
0
1
get_idx_manager
def get_idx_manager(self):return self.idx_manager
1
2
1
9
0
683
684
683
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (get_idx_manager) defined within the public class called MultiChDloader, that inherit another class.The function start at line 683 and ends at 684. 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
MultiChDloader
public
0
1
per_side_overlap_pixelcount
def per_side_overlap_pixelcount(self):return (self._img_sz - self._grid_sz) // 2
1
2
1
16
0
686
687
686
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (per_side_overlap_pixelcount) defined within the public class called MultiChDloader, that inherit another class.The function start at line 686 and ends at 687. 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
MultiChDloader
public
0
1
_get_deterministic_loc
def _get_deterministic_loc(self, index: int):"""It returns the top-left corner of the patch corresponding to index."""loc_list = self.idx_manager.get_patch_location_from_dataset_idx(index)# last dim is channel. we need to take the third and the second last element.return loc_list[1:-1]
1
3
2
28
0
692
698
692
self,index
[]
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
1
7
1
["self.idx_manager.get_patch_location_from_dataset_idx"]
0
[]
The function (_get_deterministic_loc) defined within the public class called MultiChDloader, that inherit another class.The function start at line 692 and ends at 698. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [692.0], and this function return a value. It...
CAREamics_careamics
MultiChDloader
public
0
1
compute_individual_mean_std
def compute_individual_mean_std(self):# numpy 1.19.2 has issues in computing for large arrays. https://github.com/numpy/numpy/issues/8869# mean = np.mean(self._data, axis=(0, 1, 2))# std = np.std(self._data, axis=(0, 1, 2))mean_arr = []std_arr = []for ch_idx in range(self._data.shape[-1]):mean_ = (0.0if self._skip_norm...
5
24
1
187
0
700
729
700
self
[]
Returns
{"Assign": 7, "Expr": 2, "For": 1, "If": 2, "Return": 2}
8
30
8
["range", "mean", "std", "std", "mean_arr.append", "std_arr.append", "np.array", "np.array"]
0
[]
The function (compute_individual_mean_std) defined within the public class called MultiChDloader, that inherit another class.The function start at line 700 and ends at 729. It contains 24 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. ...
CAREamics_careamics
MultiChDloader
public
0
1
compute_mean_std
def compute_mean_std(self, allow_for_validation_data=False):"""Note that we must compute this only for training data."""assert (self._is_train is True or allow_for_validation_data), "This is just allowed for training data"assert self._use_one_mu_std is True, "This is the only supported case"if self._input_idx is not No...
10
59
2
466
0
731
801
731
self,allow_for_validation_data
[]
Returns
{"Assign": 19, "Expr": 1, "If": 6, "Return": 2}
17
71
17
["self.compute_individual_mean_std", "np.mean", "range", "np.sum", "np.linalg.norm", "np.std", "range", "reshape", "np.mean", "reshape", "np.std", "reshape", "np.std", "np.repeat", "np.repeat", "np.zeros_like", "self.compute_individual_mean_std"]
0
[]
The function (compute_mean_std) defined within the public class called MultiChDloader, that inherit another class.The function start at line 731 and ends at 801. It contains 59 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [731.0], and this function return a value. It dec...
CAREamics_careamics
MultiChDloader
public
0
1
_get_random_hw
def _get_random_hw(self, h: int, w: int):"""Random starting position for the crop for the img with index `index`."""if h != self._img_sz:h_start = np.random.choice(h - self._img_sz)w_start = np.random.choice(w - self._img_sz)else:h_start = 0w_start = 0return h_start, w_start
2
8
3
61
0
803
813
803
self,h,w
[]
Returns
{"Assign": 4, "Expr": 1, "If": 1, "Return": 1}
2
11
2
["np.random.choice", "np.random.choice"]
0
[]
The function (_get_random_hw) defined within the public class called MultiChDloader, that inherit another class.The function start at line 803 and ends at 813. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [803.0], and this function return a value. It declare...
CAREamics_careamics
MultiChDloader
public
0
1
_get_img
def _get_img(self, index: Union[int, tuple[int, int]]):"""Loads an image.Crops the image such that cropped image has content."""img_tuples, noise_tuples = self._load_img(index)cropped_img_tuples = self._crop_imgs(index, *img_tuples, *noise_tuples)[:-1]cropped_noise_tuples = cropped_img_tuples[len(img_tuples) :]cropped_...
1
6
2
73
0
815
824
815
self,index
[]
Returns
{"Assign": 4, "Expr": 1, "Return": 1}
4
10
4
["self._load_img", "self._crop_imgs", "len", "len"]
0
[]
The function (_get_img) defined within the public class called MultiChDloader, that inherit another class.The function start at line 815 and ends at 824. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [815.0], and this function return a value. It declares 4.0 ...
CAREamics_careamics
MultiChDloader
public
0
1
replace_with_empty_patch
def replace_with_empty_patch(self, img_tuples):"""Replaces the content of one of the channels with background"""empty_index = self._empty_patch_fetcher.sample()empty_img_tuples, empty_img_noise_tuples = self._get_img(empty_index)assert (len(empty_img_noise_tuples) == 0), "Noise is not supported with empty patch replace...
3
13
2
85
0
826
841
826
self,img_tuples
[]
Returns
{"Assign": 3, "Expr": 3, "For": 1, "If": 1, "Return": 1}
8
16
8
["self._empty_patch_fetcher.sample", "self._get_img", "len", "range", "len", "final_img_tuples.append", "final_img_tuples.append", "tuple"]
0
[]
The function (replace_with_empty_patch) defined within the public class called MultiChDloader, that inherit another class.The function start at line 826 and ends at 841. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [826.0], and this function return a value....
CAREamics_careamics
MultiChDloader
public
0
1
get_mean_std_for_input
def get_mean_std_for_input(self):mean, std = self.get_mean_std()return mean["input"], std["input"]
1
3
1
24
0
843
845
843
self
[]
Returns
{"Assign": 1, "Return": 1}
1
3
1
["self.get_mean_std"]
0
[]
The function (get_mean_std_for_input) defined within the public class called MultiChDloader, that inherit another class.The function start at line 843 and ends at 845. 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 dec...
CAREamics_careamics
MultiChDloader
public
0
1
_compute_target
def _compute_target(self, img_tuples, alpha):if self._tar_idx_list is not None and isinstance(self._tar_idx_list, int):target = img_tuples[self._tar_idx_list]else:if self._tar_idx_list is not None:assert isinstance(self._tar_idx_list, list) or isinstance(self._tar_idx_list, tuple)img_tuples = [img_tuples[i] for i in se...
6
11
3
90
0
847
858
847
self,img_tuples,alpha
[]
Returns
{"Assign": 3, "If": 2, "Return": 1}
4
12
4
["isinstance", "isinstance", "isinstance", "np.concatenate"]
0
[]
The function (_compute_target) defined within the public class called MultiChDloader, that inherit another class.The function start at line 847 and ends at 858. It contains 11 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [847.0], and this function return a value. It decla...
CAREamics_careamics
MultiChDloader
public
0
1
_compute_input_with_alpha
def _compute_input_with_alpha(self, img_tuples, alpha_list):# assert self._normalized_input is True, "normalization should happen here"if self._input_idx is not None:inp = img_tuples[self._input_idx]else:inp = 0for alpha, img in zip(alpha_list, img_tuples):inp += img * alphaif self._normalized_input is False:return inp...
6
24
3
166
0
860
888
860
self,img_tuples,alpha_list
[]
Returns
{"Assign": 8, "AugAssign": 1, "For": 2, "If": 3, "Return": 2}
10
29
10
["zip", "inp.astype", "self.get_mean_std_for_input", "mean.squeeze", "std.squeeze", "mean.reshape", "std.reshape", "range", "len", "inp.astype"]
0
[]
The function (_compute_input_with_alpha) defined within the public class called MultiChDloader, that inherit another class.The function start at line 860 and ends at 888. It contains 24 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [860.0], and this function return a value...
CAREamics_careamics
MultiChDloader
public
0
1
_sample_alpha
def _sample_alpha(self):alpha_arr = []for i in range(self._num_channels):alpha_pos = np.random.rand()alpha = self._start_alpha_arr[i] + alpha_pos * (self._end_alpha_arr[i] - self._start_alpha_arr[i])alpha_arr.append(alpha)return alpha_arr
2
9
1
62
0
890
898
890
self
[]
Returns
{"Assign": 3, "Expr": 1, "For": 1, "Return": 1}
3
9
3
["range", "np.random.rand", "alpha_arr.append"]
0
[]
The function (_sample_alpha) defined within the public class called MultiChDloader, that inherit another class.The function start at line 890 and ends at 898. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 3.0...
CAREamics_careamics
MultiChDloader
public
0
1
_compute_input
def _compute_input(self, img_tuples):alpha = [1 / len(img_tuples) for _ in range(len(img_tuples))]if self._start_alpha_arr is not None:alpha = self._sample_alpha()inp = self._compute_input_with_alpha(img_tuples, alpha)if self._input_is_sum:inp = len(img_tuples) * inpreturn inp, alpha
4
8
2
69
0
900
908
900
self,img_tuples
[]
Returns
{"Assign": 4, "If": 2, "Return": 1}
6
9
6
["len", "range", "len", "self._sample_alpha", "self._compute_input_with_alpha", "len"]
0
[]
The function (_compute_input) defined within the public class called MultiChDloader, that inherit another class.The function start at line 900 and ends at 908. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [900.0], and this function return a value. It declare...
CAREamics_careamics
MultiChDloader
public
0
1
_get_index_from_valid_target_logic
def _get_index_from_valid_target_logic(self, index):if self._validtarget_rand_fract is not None:if np.random.rand() < self._validtarget_rand_fract:index = self._train_index_switcher.get_valid_target_index()else:index = self._train_index_switcher.get_invalid_target_index()return index
3
7
2
50
0
910
916
910
self,index
[]
Returns
{"Assign": 2, "If": 2, "Return": 1}
3
7
3
["np.random.rand", "self._train_index_switcher.get_valid_target_index", "self._train_index_switcher.get_invalid_target_index"]
0
[]
The function (_get_index_from_valid_target_logic) defined within the public class called MultiChDloader, that inherit another class.The function start at line 910 and ends at 916. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [910.0], and this function return...
CAREamics_careamics
MultiChDloader
public
0
1
_rotate2D
def _rotate2D(self, img_tuples, noise_tuples):img_kwargs = {}for i, img in enumerate(img_tuples):for k in range(len(img)):img_kwargs[f"img{i}_{k}"] = img[k]noise_kwargs = {}for i, nimg in enumerate(noise_tuples):for k in range(len(nimg)):noise_kwargs[f"noise{i}_{k}"] = nimg[k]keys = list(img_kwargs.keys()) + list(noise...
12
36
3
283
0
918
958
918
self,img_tuples,noise_tuples
[]
Returns
{"Assign": 8, "Expr": 5, "For": 6, "If": 2, "Return": 1}
26
41
26
["enumerate", "range", "len", "enumerate", "range", "len", "list", "img_kwargs.keys", "list", "noise_kwargs.keys", "self._rotation_transform.add_targets", "self._rotation_transform", "enumerate", "len", "rotated_img_tuples.append", "rotated_img_tuples.append", "np.concatenate", "range", "len", "enumerate", "len", "rota...
0
[]
The function (_rotate2D) defined within the public class called MultiChDloader, that inherit another class.The function start at line 918 and ends at 958. It contains 36 lines of code and it has a cyclomatic complexity of 12. It takes 3 parameters, represented as [918.0], and this function return a value. It declares 2...
CAREamics_careamics
MultiChDloader
public
0
1
_rotate
def _rotate(self, img_tuples, noise_tuples):if self._5Ddata:return self._rotate3D(img_tuples, noise_tuples)else:return self._rotate2D(img_tuples, noise_tuples)
2
5
3
34
0
960
965
960
self,img_tuples,noise_tuples
[]
Returns
{"If": 1, "Return": 2}
2
6
2
["self._rotate3D", "self._rotate2D"]
0
[]
The function (_rotate) defined within the public class called MultiChDloader, that inherit another class.The function start at line 960 and ends at 965. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [960.0], and this function return a value. It declares 2.0 f...
CAREamics_careamics
MultiChDloader
public
0
1
_rotate3D
def _rotate3D(self, img_tuples, noise_tuples):img_kwargs = {}# random flip in z directionflip_z = self._flipz_3D and np.random.rand() < 0.5for i, img in enumerate(img_tuples):for j in range(self._depth3D):for k in range(len(img)):if flip_z:z_idx = self._depth3D - 1 - jelse:z_idx = jimg_kwargs[f"img{i}_{z_idx}_{k}"] = i...
21
76
3
470
0
967
1,047
967
self,img_tuples,noise_tuples
[]
Returns
{"Assign": 15, "Expr": 7, "For": 10, "If": 4, "Return": 1}
39
81
39
["np.random.rand", "enumerate", "range", "range", "len", "enumerate", "range", "range", "len", "list", "img_kwargs.keys", "list", "noise_kwargs.keys", "self._rotation_transform.add_targets", "self._rotation_transform", "enumerate", "len", "rotated_img_tuples.append", "np.concatenate", "range", "range", "len", "temp_arr...
0
[]
The function (_rotate3D) defined within the public class called MultiChDloader, that inherit another class.The function start at line 967 and ends at 1047. It contains 76 lines of code and it has a cyclomatic complexity of 21. It takes 3 parameters, represented as [967.0], and this function return a value. It declares ...
CAREamics_careamics
MultiChDloader
public
0
1
get_uncorrelated_img_tuples
def get_uncorrelated_img_tuples(self, index):"""Content of channels like actin and nuclei is "correlated" in itsrespective location, this function allows to pick channels' contentfrom different patches of the image to make it "uncorrelated"."""img_tuples, noise_tuples = self._get_img(index)assert len(noise_tuples) == 0...
2
9
2
82
0
1,049
1,062
1,049
self,index
[]
Returns
{"Assign": 4, "Expr": 2, "For": 1, "Return": 1}
8
14
8
["self._get_img", "len", "range", "len", "np.random.randint", "len", "self._get_img", "img_tuples.append"]
0
[]
The function (get_uncorrelated_img_tuples) defined within the public class called MultiChDloader, that inherit another class.The function start at line 1049 and ends at 1062. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1049.0], and this function return a v...
CAREamics_careamics
MultiChDloader
public
0
1
__getitem__
def __getitem__(self, index: Union[int, tuple[int, int]]) -> tuple[np.ndarray, np.ndarray]:# Vera: input can be both real microscopic image and two separate channels that are summed in the codeif self._train_index_switcher is not None:index = self._get_index_from_valid_target_logic(index)if (self._uncorrelated_channels...
14
36
2
277
0
1,064
1,121
1,064
self,index
[]
tuple[np.ndarray, np.ndarray]
{"Assign": 13, "Expr": 2, "If": 9, "Return": 1}
17
58
17
["self._get_index_from_valid_target_logic", "np.random.rand", "self.get_uncorrelated_img_tuples", "self._get_img", "np.random.rand", "self.replace_with_empty_patch", "self._rotate", "len", "np.sqrt", "self._compute_input", "len", "zip", "self._compute_target", "self.normalize_target", "output.append", "output.append", ...
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 MultiChDloader, that inherit another class.The function start at line 1064 and ends at 1121. It contains 36 lines of code and it has a cyclomatic complexity of 14. It takes 2 parameters, represented as [1064.0] and does not return any value. It declares ...
CAREamics_careamics
public
public
0
0
l2
def l2(x):return np.sqrt(np.mean(np.array(x) ** 2))
1
2
1
24
0
13
14
13
x
[]
Returns
{"Return": 1}
3
2
3
["np.sqrt", "np.mean", "np.array"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953269_alisaifee_flask_limiter.tests.test_decorators_py.test_non_route_decoration_multiple_sequential_limits_per_request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lv...
The function (l2) defined within the public class called public.The function start at line 13 and ends at 14. 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 3.0 functions, It has 3.0 functions called inside wh...
CAREamics_careamics
MultiCropDset
public
0
0
__init__
def __init__(self,data_config,fpath: str,load_data_fn=None,val_fraction=None,test_fraction=None,):assert (data_config.input_is_sum == True), "This dataset is designed for sum of images"self._img_sz = data_config.image_sizeself._enable_rotation = data_config.enable_rotation_augself._background_values = data_config.backg...
9
36
6
215
0
18
61
18
self,data_config,fpath,load_data_fn,val_fraction,test_fraction
[]
None
{"Assign": 9, "Expr": 2, "For": 3, "If": 3}
10
44
10
["load_data_fn", "enumerate", "range", "len", "enumerate", "x.astype", "final_data_arr.append", "print", "len", "len"]
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 MultiCropDset.The function start at line 18 and ends at 61. It contains 36 lines of code and it has a cyclomatic complexity of 9. It takes 6 parameters, represented as [18.0] and does not return any value. It declares 10.0 functions, It has 10.0 functions c...
CAREamics_careamics
MultiCropDset
public
0
0
get_max_val
def get_max_val(self):return self.max_val
1
2
1
9
0
63
64
63
self
[]
Returns
{"Return": 1}
0
2
0
[]
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 MultiCropDset.The function start at line 63 and ends at 64. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 1.0 function calling this function which ...
CAREamics_careamics
MultiCropDset
public
0
0
compute_mean_std
def compute_mean_std(self):mean_tar_dict = defaultdict(list)std_tar_dict = defaultdict(list)mean_inp = []std_inp = []for _ in range(30000):crops = []for ch_idx in range(len(self._data)):crop = self.sample_crop(ch_idx)mean_tar_dict[ch_idx].append(np.mean(crop))std_tar_dict[ch_idx].append(np.std(crop))crops.append(crop)i...
5
28
1
293
0
66
98
66
self
[]
Returns
{"Assign": 14, "AugAssign": 1, "Expr": 7, "For": 4, "Return": 1}
35
33
35
["defaultdict", "defaultdict", "range", "range", "len", "self.sample_crop", "append", "np.mean", "append", "np.std", "crops.append", "mean_inp.append", "np.mean", "std_inp.append", "np.std", "defaultdict", "defaultdict", "len", "range", "append", "np.mean", "append", "l2", "reshape", "np.array", "reshape", "np.array", ...
0
[]
The function (compute_mean_std) defined within the public class called MultiCropDset.The function start at line 66 and ends at 98. It contains 28 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 35.0 functions, and It has 35...
CAREamics_careamics
MultiCropDset
public
0
0
set_mean_std
def set_mean_std(self, mean_dict, std_dict):self._data_mean = mean_dictself._data_std = std_dict
1
3
3
19
0
100
102
100
self,mean_dict,std_dict
[]
None
{"Assign": 2}
0
3
0
[]
0
[]
The function (set_mean_std) defined within the public class called MultiCropDset.The function start at line 100 and ends at 102. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [100.0] and does not return any value..
CAREamics_careamics
MultiCropDset
public
0
0
get_mean_std
def get_mean_std(self):return self._data_mean, self._data_std
1
2
1
13
0
104
105
104
self
[]
Returns
{"Return": 1}
0
2
0
[]
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 MultiCropDset.The function start at line 104 and ends at 105. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 1.0 function calling this function whi...
CAREamics_careamics
MultiCropDset
public
0
0
get_num_frames
def get_num_frames(self):return len(self._data)
1
2
1
12
0
107
108
107
self
[]
Returns
{"Return": 1}
1
2
1
["len"]
0
[]
The function (get_num_frames) defined within the public class called MultiCropDset.The function start at line 107 and ends at 108. 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
MultiCropDset
public
0
0
crop_probablities
def crop_probablities(self, ch_idx):sizes = np.array([np.prod(x.shape) for x in self._data[ch_idx]])return sizes / sizes.sum()
2
3
2
41
0
111
113
111
self,ch_idx
[]
Returns
{"Assign": 1, "Return": 1}
3
3
3
["np.array", "np.prod", "sizes.sum"]
0
[]
The function (crop_probablities) defined within the public class called MultiCropDset.The function start at line 111 and ends at 113. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [111.0], and this function return a value. It declares 3.0 functions, and It h...
CAREamics_careamics
MultiCropDset
public
0
0
sample_crop
def sample_crop(self, ch_idx):idx = Nonecount = 0while idx is None:count += 1idx = np.random.choice(len(self._data[ch_idx]), p=self.crop_probablities(ch_idx))data = self._data[ch_idx][idx]if data.shape[0] >= self._img_sz[0] and data.shape[1] >= self._img_sz[1]:h = np.random.randint(0, data.shape[0] - self._img_sz[0])w ...
5
18
2
178
0
115
133
115
self,ch_idx
[]
Returns
{"Assign": 7, "AugAssign": 1, "If": 2, "Return": 2, "While": 1}
6
19
6
["np.random.choice", "len", "self.crop_probablities", "np.random.randint", "np.random.randint", "ValueError"]
0
[]
The function (sample_crop) defined within the public class called MultiCropDset.The function start at line 115 and ends at 133. It contains 18 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [115.0], and this function return a value. It declares 6.0 functions, and It has 6....
CAREamics_careamics
MultiCropDset
public
0
0
len_per_channel
def len_per_channel(self, ch_idx):return np.sum([np.prod(x.shape) for x in self._data[ch_idx]]) / np.prod(self._img_sz)
2
4
2
41
0
135
138
135
self,ch_idx
[]
Returns
{"Return": 1}
3
4
3
["np.sum", "np.prod", "np.prod"]
0
[]
The function (len_per_channel) defined within the public class called MultiCropDset.The function start at line 135 and ends at 138. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [135.0], and this function return a value. It declares 3.0 functions, and It has...
CAREamics_careamics
MultiCropDset
public
0
0
imgs_for_patch
def imgs_for_patch(self):return [self.sample_crop(ch_idx) for ch_idx in range(len(self._data))]
2
2
1
26
0
140
141
140
self
[]
Returns
{"Return": 1}
3
2
3
["self.sample_crop", "range", "len"]
0
[]
The function (imgs_for_patch) defined within the public class called MultiCropDset.The function start at line 140 and ends at 141. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0 ...
CAREamics_careamics
MultiCropDset
public
0
0
__len__
def __len__(self):len_per_channel = [self.len_per_channel(ch_idx) for ch_idx in range(len(self._data))]return int(np.max(len_per_channel))
2
5
1
37
0
143
147
143
self
[]
Returns
{"Assign": 1, "Return": 1}
5
5
5
["self.len_per_channel", "range", "len", "int", "np.max"]
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 MultiCropDset.The function start at line 143 and ends at 147. 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 5.0 functions, It has 5.0 functions ca...
CAREamics_careamics
MultiCropDset
public
0
0
_rotate
def _rotate(self, img_tuples):return self._rotate2D(img_tuples)
1
2
2
14
0
149
150
149
self,img_tuples
[]
Returns
{"Return": 1}
1
2
1
["self._rotate2D"]
0
[]
The function (_rotate) defined within the public class called MultiCropDset.The function start at line 149 and ends at 150. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [149.0], and this function return a value. It declare 1.0 function, and It has 1.0 funct...
CAREamics_careamics
MultiCropDset
public
0
0
_rotate2D
def _rotate2D(self, img_tuples):img_kwargs = {}for i, img in enumerate(img_tuples):for k in range(len(img)):img_kwargs[f"img{i}_{k}"] = img[k]keys = list(img_kwargs.keys())self._rotation_transform.add_targets({k: "image" for k in keys})rot_dic = self._rotation_transform(image=img_tuples[0][0], **img_kwargs)rotated_img_...
7
19
2
160
0
152
173
152
self,img_tuples
[]
Returns
{"Assign": 5, "Expr": 3, "For": 3, "If": 1, "Return": 1}
14
22
14
["enumerate", "range", "len", "list", "img_kwargs.keys", "self._rotation_transform.add_targets", "self._rotation_transform", "enumerate", "len", "rotated_img_tuples.append", "rotated_img_tuples.append", "np.concatenate", "range", "len"]
0
[]
The function (_rotate2D) defined within the public class called MultiCropDset.The function start at line 152 and ends at 173. It contains 19 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [152.0], and this function return a value. It declares 14.0 functions, and It has 14....
CAREamics_careamics
MultiCropDset
public
0
0
_compute_input
def _compute_input(self, imgs):inp = 0for img in imgs:inp += imginp = inp[None]inp = (inp - self._data_mean["input"]) / (self._data_std["input"])return inp
2
7
2
47
0
175
182
175
self,imgs
[]
Returns
{"Assign": 3, "AugAssign": 1, "For": 1, "Return": 1}
0
8
0
[]
0
[]
The function (_compute_input) defined within the public class called MultiCropDset.The function start at line 175 and ends at 182. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [175.0], and this function return a value..
CAREamics_careamics
MultiCropDset
public
0
0
_compute_target
def _compute_target(self, imgs):imgs = np.stack(imgs)target = (imgs - self._data_mean["target"]) / (self._data_std["target"])return target
1
4
2
38
0
184
187
184
self,imgs
[]
Returns
{"Assign": 2, "Return": 1}
1
4
1
["np.stack"]
0
[]
The function (_compute_target) defined within the public class called MultiCropDset.The function start at line 184 and ends at 187. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [184.0], and this function return a value. It declare 1.0 function, and It has 1...
CAREamics_careamics
MultiCropDset
public
0
0
__getitem__
def __getitem__(self, idx):imgs = self.imgs_for_patch()if self._enable_rotation:imgs = self._rotate(imgs)inp = self._compute_input(imgs)target = self._compute_target(imgs)return inp, target
2
7
2
47
0
189
196
189
self,idx
[]
Returns
{"Assign": 4, "If": 1, "Return": 1}
4
8
4
["self.imgs_for_patch", "self._rotate", "self._compute_input", "self._compute_target"]
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 MultiCropDset.The function start at line 189 and ends at 196. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [189.0], and this function return a value. It declares 4.0 functions, It has 4.0 func...
CAREamics_careamics
TwoChannelData
public
0
1
__init__
def __init__(self, data_arr1, data_arr2, paths_data1=None, paths_data2=None):assert len(data_arr1) == len(data_arr2)self.paths1 = paths_data1self.paths2 = paths_data2self._data = []for i in range(len(data_arr1)):assert data_arr1[i].shape == data_arr2[i].shapeassert (len(data_arr1[i].shape) == 3), f"Each element in data...
2
15
5
123
0
18
33
18
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 18 and ends at 33. It contains 15 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [18.0] and does not return any value. It declares 7.0 functi...
CAREamics_careamics
TwoChannelData
public
0
1
__len__
def __len__(self):n = 0for x in self._data:n += x.shape[0]return n
2
5
1
25
0
35
39
35
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 35 and ends at 39. 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 ca...
CAREamics_careamics
TwoChannelData
public
0
1
__getitem__
def __getitem__(self, idx):n = 0for dataidx, x in enumerate(self._data):if idx < n + x.shape[0]:if self.paths1 is None:return x[idx - n], Noneelse:return x[idx - n], (self.paths1[dataidx], self.paths2[dataidx])n += x.shape[0]raise IndexError("Index out of range")
4
10
2
88
0
41
50
41
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 41 and ends at 50. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [41.0], and this function return a value. It declares 2.0...
CAREamics_careamics
TwoChannelData
public
0
1
__init__
def __init__(self, data_arr, paths=None):self.paths = pathsself._data = data_arr
1
3
3
21
0
58
61
58
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 58 and ends at 61. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [58.0] and does not return any value. It declares 7.0 functio...
CAREamics_careamics
TwoChannelData
public
0
1
__len__
def __len__(self):n = 0for x in self._data:n += x.shape[0]return n
2
5
1
25
0
63
67
35
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 63 and ends at 67. 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 ca...
CAREamics_careamics
TwoChannelData
public
0
1
__getitem__
def __getitem__(self, idx):n = 0for dataidx, x in enumerate(self._data):if idx < n + x.shape[0]:if self.paths is None:return x[idx - n], Noneelse:return x[idx - n], (self.paths[dataidx])n += x.shape[0]raise IndexError("Index out of range")
4
10
2
81
0
69
78
69
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 69 and ends at 78. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [69.0], and this function return a value. It declares 2.0...
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
82
98
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 82 and ends at 98. 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 functi...
CAREamics_careamics
SingleFileLCDset
public
0
1
data_path
def data_path(self):return self._fpath
1
2
1
9
0
101
102
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 101 and ends at 102. 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
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
104
105
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 104 and ends at 105. 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
load_data
def load_data(self,data_config: MicroSplitDataConfig,datasplit_type: DataSplitType,load_data_fn: Callable,val_fraction=None,test_fraction=None,allow_generation=None,):self._data = self._preloaded_dataassert "channel_1" not in data_config or isinstance(data_config.channel_1, str)assert "channel_2" not in data_config or ...
4
14
7
85
0
107
120
107
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 107 and ends at 120. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 7 parameters, represented as [107.0] and does not return any value. It declares 4.0 ...