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 | StableExponential | public | 0 | 0 | __init__ | def __init__(self, tensor):self._raw_tensor = tensorposneg_dic = self.posneg_separation(self._raw_tensor)self.pos_f, self.neg_f = posneg_dic["filter"]self.pos_data, self.neg_data = posneg_dic["value"] | 1 | 5 | 2 | 46 | 0 | 215 | 219 | 215 | self,tensor | [] | None | {"Assign": 4} | 1 | 5 | 1 | ["self.posneg_separation"] | 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 StableExponential.The function start at line 215 and ends at 219. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [215.0] and does not return any value. It declare 1.0 function, It has 1.0 function ... |
CAREamics_careamics | StableExponential | public | 0 | 0 | posneg_separation | def posneg_separation(self, tensor):pos = tensor > 0pos_tensor = torch.clip(tensor, min=0)neg = tensor <= 0neg_tensor = torch.clip(tensor, max=0)return {"filter": [pos, neg], "value": [pos_tensor, neg_tensor]} | 1 | 6 | 2 | 59 | 0 | 221 | 228 | 221 | self,tensor | [] | Returns | {"Assign": 4, "Return": 1} | 2 | 8 | 2 | ["torch.clip", "torch.clip"] | 0 | [] | The function (posneg_separation) defined within the public class called StableExponential.The function start at line 221 and ends at 228. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [221.0], and this function return a value. It declares 2.0 functions, and ... |
CAREamics_careamics | StableExponential | public | 0 | 0 | exp | def exp(self):return torch.exp(self.neg_data) * self.neg_f + (1 + self.pos_data) * self.pos_f | 1 | 2 | 1 | 30 | 0 | 230 | 231 | 230 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["torch.exp"] | 102 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3924956_keon_algorithms.algorithms.maths.fft_py.fft", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3965453_johnveitch_cpnest.cpnest.proposal_py.EnsembleStretch.get_sample", "_.content.gdrive.MyDrive.Phd_Thesis.Data... | The function (exp) defined within the public class called StableExponential.The function start at line 230 and ends at 231. 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 calle... |
CAREamics_careamics | StableExponential | public | 0 | 0 | log | def log(self):return self.neg_data * self.neg_f + torch.log(1 + self.pos_data) * self.pos_f | 1 | 2 | 1 | 28 | 0 | 233 | 234 | 233 | self | [] | Returns | {"Return": 1} | 1 | 2 | 1 | ["torch.log"] | 548 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3580082_pacificbiosciences_falcon.falcon_kit.io_py.deserialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3580082_pacificbiosciences_falcon.falcon_kit.io_py.read_as_json", "_.content.gdrive.MyDrive.Phd_Thesis.D... | The function (log) defined within the public class called StableExponential.The function start at line 233 and ends at 234. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function calle... |
CAREamics_careamics | StableExponential | public | 0 | 0 | __init__ | def __init__(self, logvar: torch.Tensor, enable_stable: bool = True, var_eps: float = 1e-6):"""Constructor.Parameters----------logvar: torch.TensorThe input (true) logvar vector, to be converted in the Stable version.enable_stable: bool, optionalWhether to compute the stable version of log-variance. Default is `True`.v... | 1 | 6 | 4 | 41 | 0 | 243 | 260 | 243 | self,tensor | [] | None | {"Assign": 4} | 1 | 5 | 1 | ["self.posneg_separation"] | 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 StableExponential.The function start at line 243 and ends at 260. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [243.0] and does not return any value. It declare 1.0 function, It has 1.0 function ... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | get | def get(self) -> torch.Tensor:if self._enable_stable is False:return self._lvreturn torch.log(self.get_var()) | 2 | 4 | 1 | 31 | 0 | 262 | 266 | 262 | self | [] | torch.Tensor | {"If": 1, "Return": 2} | 2 | 5 | 2 | ["torch.log", "self.get_var"] | 2,119 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.28233542_gluufederation_community_edition_containers.py... | The function (get) defined within the public class called StableLogVar.The function start at line 262 and ends at 266. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called insi... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | get_var | def get_var(self) -> torch.Tensor:"""Get Variance from Log-Variance."""if self._enable_stable is False:return torch.exp(self._lv)return StableExponential(self._lv).exp() + self._eps | 2 | 4 | 1 | 41 | 0 | 268 | 274 | 268 | self | [] | torch.Tensor | {"Expr": 1, "If": 1, "Return": 2} | 3 | 7 | 3 | ["torch.exp", "exp", "StableExponential"] | 0 | [] | The function (get_var) defined within the public class called StableLogVar.The function start at line 268 and ends at 274. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions ca... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | get_std | def get_std(self) -> torch.Tensor:return torch.sqrt(self.get_var()) | 1 | 2 | 1 | 20 | 0 | 276 | 277 | 276 | self | [] | torch.Tensor | {"Return": 1} | 2 | 2 | 2 | ["torch.sqrt", "self.get_var"] | 0 | [] | The function (get_std) defined within the public class called StableLogVar.The function start at line 276 and ends at 277. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions ca... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | is_3D | def is_3D(self) -> bool:"""Check if the _lv tensor is 3D.Recall that, in this framework, tensors have shape (B, C, [Z], Y, X)."""return self._lv.dim() == 5 | 1 | 2 | 1 | 18 | 0 | 280 | 285 | 280 | self | [] | bool | {"Expr": 1, "Return": 1} | 1 | 6 | 1 | ["self._lv.dim"] | 0 | [] | The function (is_3D) defined within the public class called StableLogVar.The function start at line 280 and ends at 285. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called ... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | centercrop_to_size | def centercrop_to_size(self, size: Sequence[int]) -> None:"""Centercrop the log-variance tensor to the desired size.Parameters----------size: torch.TensorThe desired size of the log-variance tensor."""assert not self.is_3D, "Centercrop is implemented only for 2D tensors."if self._lv.shape[-1] == size:returndiff = self.... | 3 | 7 | 2 | 77 | 0 | 287 | 303 | 287 | self,size | [] | None | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1} | 1 | 17 | 1 | ["F.center_crop"] | 0 | [] | The function (centercrop_to_size) defined within the public class called StableLogVar.The function start at line 287 and ends at 303. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [287.0] and does not return any value. It declare 1.0 function, and It has 1.0... |
CAREamics_careamics | StableExponential | public | 0 | 0 | __init__ | def __init__(self, mean):self._mean = mean | 1 | 2 | 2 | 12 | 0 | 308 | 309 | 308 | self,tensor | [] | None | {"Assign": 4} | 1 | 5 | 1 | ["self.posneg_separation"] | 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 StableExponential.The function start at line 308 and ends at 309. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [308.0] and does not return any value. It declare 1.0 function, It has 1.0 function ... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | get | def get(self) -> torch.Tensor:return self._mean | 1 | 2 | 1 | 13 | 0 | 311 | 312 | 311 | self | [] | torch.Tensor | {"If": 1, "Return": 2} | 2 | 5 | 2 | ["torch.log", "self.get_var"] | 2,119 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.28233542_gluufederation_community_edition_containers.py... | The function (get) defined within the public class called StableLogVar.The function start at line 311 and ends at 312. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called insi... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | is_3D | def is_3D(self) -> bool:"""Check if the _lv tensor is 3D.Recall that, in this framework, tensors have shape (B, C, [Z], Y, X)."""return self._lv.dim() == 5 | 1 | 2 | 1 | 18 | 0 | 315 | 320 | 280 | self | [] | bool | {"Expr": 1, "Return": 1} | 1 | 6 | 1 | ["self._lv.dim"] | 0 | [] | The function (is_3D) defined within the public class called StableLogVar.The function start at line 315 and ends at 320. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called ... |
CAREamics_careamics | StableLogVar | public | 0 | 0 | centercrop_to_size | def centercrop_to_size(self, size: Sequence[int]) -> None:"""Centercrop the log-variance tensor to the desired size.Parameters----------size: torch.TensorThe desired size of the log-variance tensor."""assert not self.is_3D, "Centercrop is implemented only for 2D tensors."if self._lv.shape[-1] == size:returndiff = self.... | 3 | 7 | 2 | 77 | 0 | 322 | 339 | 287 | self,size | [] | None | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1} | 1 | 17 | 1 | ["F.center_crop"] | 0 | [] | The function (centercrop_to_size) defined within the public class called StableLogVar.The function start at line 322 and ends at 339. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [287.0] and does not return any value. It declare 1.0 function, and It has 1.0... |
CAREamics_careamics | public | public | 0 | 0 | allow_numpy.numpy_wrapper | def numpy_wrapper(*args, **kwargs):new_args = []for arg in args:if isinstance(arg, np.ndarray):arg = torch.Tensor(arg)new_args.append(arg)new_args = tuple(new_args)output = func(*new_args, **kwargs)return output | 3 | 9 | 2 | 60 | 0 | 348 | 357 | 348 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (allow_numpy.numpy_wrapper) defined within the public class called public.The function start at line 348 and ends at 357. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [348.0] and does not return any value.. |
CAREamics_careamics | public | public | 0 | 0 | allow_numpy | def allow_numpy(func):"""All optional arguments are passed as is. positional arguments are checked. if they are numpy array,they are converted to torch Tensor."""def numpy_wrapper(*args, **kwargs):new_args = []for arg in args:if isinstance(arg, np.ndarray):arg = torch.Tensor(arg)new_args.append(arg)new_args = tuple(new... | 1 | 3 | 1 | 10 | 3 | 342 | 359 | 342 | func | ['arg', 'output', 'new_args'] | Returns | {"Assign": 4, "Expr": 2, "For": 1, "If": 1, "Return": 2} | 5 | 18 | 5 | ["isinstance", "torch.Tensor", "new_args.append", "tuple", "func"] | 0 | [] | The function (allow_numpy) defined within the public class called public.The function start at line 342 and ends at 359. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 functions, and It has 5.0 functions ... |
CAREamics_careamics | StableExponential | public | 0 | 0 | __init__ | def __init__(self, size=None, scale=None, mode="bilinear", align_corners=False):super().__init__()assert (size is None) == (scale is not None)self.size = sizeself.scale = scaleself.mode = modeself.align_corners = align_corners | 1 | 7 | 5 | 61 | 0 | 365 | 371 | 365 | self,tensor | [] | None | {"Assign": 4} | 1 | 5 | 1 | ["self.posneg_separation"] | 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 StableExponential.The function start at line 365 and ends at 371. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [365.0] and does not return any value. It declare 1.0 function, It has 1.0 function ... |
CAREamics_careamics | Interpolate | public | 0 | 1 | forward | def forward(self, x):out = F.interpolate(x,size=self.size,scale_factor=self.scale,mode=self.mode,align_corners=self.align_corners,)return out | 1 | 9 | 2 | 42 | 0 | 373 | 381 | 373 | self,x | [] | Returns | {"Assign": 1, "Return": 1} | 1 | 9 | 1 | ["F.interpolate"] | 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 Interpolate, that inherit another class.The function start at line 373 and ends at 381. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [373.0], and this function return a value. It declare 1.0 funct... |
CAREamics_careamics | public | public | 0 | 0 | kl_normal_mc | def kl_normal_mc(z, p_mulv, q_mulv):"""One-sample estimation of element-wise KL between two diagonalmultivariate normal distributions. Any number of dimensions,broadcasting supported (be careful).:param z::param p_mulv::param q_mulv::return:"""assert isinstance(p_mulv, tuple)assert isinstance(q_mulv, tuple)p_mu, p_lv =... | 1 | 10 | 3 | 86 | 4 | 384 | 404 | 384 | z,p_mulv,q_mulv | ['q_std', 'p_distrib', 'q_distrib', 'p_std'] | Returns | {"Assign": 6, "Expr": 1, "Return": 1} | 10 | 21 | 10 | ["isinstance", "isinstance", "p_lv.get_std", "q_lv.get_std", "Normal", "p_mu.get", "Normal", "q_mu.get", "q_distrib.log_prob", "p_distrib.log_prob"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.models.lvae.stochastic_py.NormalStochasticBlock.compute_kl_metrics"] | The function (kl_normal_mc) defined within the public class called public.The function start at line 384 and ends at 404. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [384.0], and this function return a value. It declares 10.0 functions, It has 10.0 functio... |
CAREamics_careamics | public | public | 0 | 0 | lvae_predict_single_sample | def lvae_predict_single_sample(model: LVAE,likelihood_obj: LikelihoodModule,input: torch.Tensor,) -> tuple[torch.Tensor, torch.Tensor | None]:"""Generate a single sample prediction from an LVAE model, for a given input.Parameters----------model : LVAETrained LVAE model.likelihood_obj : LikelihoodModuleInstance of a lik... | 1 | 11 | 3 | 71 | 0 | 17 | 53 | 17 | model,likelihood_obj,input | [] | tuple[torch.Tensor, torch.Tensor | None] | {"AnnAssign": 1, "Assign": 2, "Expr": 2, "Return": 1, "With": 1} | 4 | 37 | 4 | ["model.eval", "torch.no_grad", "model", "likelihood_obj.get_mean_lv"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.lvae_prediction_py.lvae_predict_mmse_tiled_batch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_util... | The function (lvae_predict_single_sample) defined within the public class called public.The function start at line 17 and ends at 53. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [17.0] and does not return any value. It declares 4.0 functions, It has 4.0 fu... |
CAREamics_careamics | public | public | 0 | 0 | lvae_predict_tiled_batch | def lvae_predict_tiled_batch(model: LVAE,likelihood_obj: LikelihoodModule,input: tuple[Any],) -> tuple[tuple[Any], tuple[Any] | None]:# TODO: fix docstring return types, ... too many output options"""Generate a single sample prediction from an LVAE model, for a given input.Parameters----------model : LVAETrained LVAE m... | 2 | 13 | 3 | 94 | 1 | 56 | 93 | 56 | model,likelihood_obj,input | ['log_var_output'] | tuple[tuple[Any], tuple[Any] | None] | {"AnnAssign": 2, "Assign": 3, "Expr": 1, "Return": 1} | 1 | 38 | 1 | ["lvae_predict_single_sample"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.prediction_utils.test_lvae_prediction_py.test_lvae_predict_single_sample", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.prediction_utils.test_lv... | The function (lvae_predict_tiled_batch) defined within the public class called public.The function start at line 56 and ends at 93. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [56.0] and does not return any value. It declare 1.0 function, It has 1.0 functi... |
CAREamics_careamics | public | public | 0 | 0 | lvae_predict_mmse_tiled_batch | def lvae_predict_mmse_tiled_batch(model: LVAE,likelihood_obj: LikelihoodModule,input: tuple[Any],mmse_count: int,) -> tuple[tuple[Any], tuple[Any], tuple[Any] | None]:# TODO: fix docstring return types, ... hard to make readable"""Generate the MMSE (minimum mean squared error) prediction, for a given input.This is calc... | 5 | 26 | 4 | 216 | 7 | 96 | 158 | 96 | model,likelihood_obj,input,mmse_count | ['mmse_prediction_std', 'sample_predictions', 'mmse_prediction', 'log_var', 'log_var_output', 'input_shape', 'output_shape'] | tuple[tuple[Any], tuple[Any], tuple[Any] | None] | {"AnnAssign": 3, "Assign": 10, "Expr": 1, "For": 1, "If": 2, "Return": 1} | 6 | 63 | 6 | ["ValueError", "torch.zeros", "range", "lvae_predict_single_sample", "torch.mean", "torch.std"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.prediction_utils.test_lvae_prediction_py.test_lvae_predict_mmse_tiled_batch"] | The function (lvae_predict_mmse_tiled_batch) defined within the public class called public.The function start at line 96 and ends at 158. It contains 26 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [96.0] and does not return any value. It declares 6.0 functions, It has 6.... |
CAREamics_careamics | public | public | 0 | 0 | convert_outputs | def convert_outputs(predictions: list[Any], tiled: bool) -> list[NDArray]:"""Convert the Lightning trainer outputs to the desired form.This method allows stitching back together tiled predictions.Parameters----------predictions : listPredictions that are output from `Trainer.predict`.tiled : boolWhether the predictions... | 3 | 9 | 2 | 60 | 2 | 12 | 41 | 12 | predictions,tiled | ['predictions_output', 'predictions_comb'] | list[NDArray] | {"Assign": 3, "Expr": 1, "If": 2, "Return": 2} | 4 | 30 | 4 | ["len", "combine_batches", "stitch_prediction", "combine_batches"] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.careamist_py.CAREamist.predict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.lightning.callbacks.prediction_writer_callback.test_predic... | The function (convert_outputs) defined within the public class called public.The function start at line 12 and ends at 41. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [12.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions call... |
CAREamics_careamics | public | public | 0 | 0 | convert_outputs_microsplit | def convert_outputs_microsplit(predictions: list[tuple[NDArray, NDArray]], dataset) -> tuple[NDArray, NDArray]:"""Convert microsplit Lightning trainer outputs using eval_utils stitching functions.This function processes microsplit predictions that return (tile_prediction, tile_std) tuplesand stitches them back together... | 4 | 12 | 2 | 104 | 6 | 44 | 83 | 44 | predictions,dataset | ['tile_stds_arr', 'stitched_stds', 'tiles_arr', 'stitched_predictions', 'tile_predictions', 'tile_stds'] | tuple[NDArray, NDArray] | {"Assign": 6, "Expr": 1, "If": 1, "Return": 1} | 6 | 40 | 6 | ["len", "ValueError", "np.concatenate", "np.concatenate", "stitch_prediction_vae", "stitch_prediction_vae"] | 0 | [] | The function (convert_outputs_microsplit) defined within the public class called public.The function start at line 44 and ends at 83. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [44.0] and does not return any value. It declares 6.0 functions, and It has 6... |
CAREamics_careamics | public | public | 0 | 0 | combine_batches | def combine_batches(predictions: list[Any], tiled: bool) -> Union[list[NDArray], tuple[list[NDArray], list[TileInformation]]]:"""If predictions are in batches, they will be combined.# TODO improve description!Parameters----------predictions : listPredictions that are output from `Trainer.predict`.tiled : boolWhether th... | 2 | 7 | 2 | 51 | 0 | 107 | 130 | 107 | predictions,tiled | [] | tuple[list[NDArray], list[TileInformation]] | {"Expr": 1} | 0 | 3 | 0 | [] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.prediction_outputs_py.convert_outputs"] | The function (combine_batches) defined within the public class called public.The function start at line 107 and ends at 130. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [107.0] and does not return any value. It has 1.0 function calling this function which i... |
CAREamics_careamics | public | public | 0 | 0 | _combine_tiled_batches | def _combine_tiled_batches(predictions: list[tuple[NDArray, list[TileInformation]]],) -> tuple[list[NDArray], list[TileInformation]]:"""Combine batches from tiled output.Parameters----------predictions : list of (numpy.ndarray, list of TileInformation)Predictions that are output from `Trainer.predict`. For tiled batche... | 4 | 10 | 1 | 73 | 1 | 133 | 160 | 133 | predictions | ['tile_infos'] | tuple[list[NDArray], list[TileInformation]] | {"AnnAssign": 1, "Assign": 1, "Expr": 1, "Return": 1} | 1 | 28 | 1 | ["_combine_array_batches"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.prediction_outputs_py.combine_batches"] | The function (_combine_tiled_batches) defined within the public class called public.The function start at line 133 and ends at 160. It contains 10 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 declare 1.0 function, It has 1.0 function ... |
CAREamics_careamics | public | public | 0 | 0 | _combine_array_batches | def _combine_array_batches(predictions: list[NDArray]) -> list[NDArray]:"""Combine batches of arrays.Parameters----------predictions : listPrediction arrays that are output from `Trainer.predict`. A list of arrays thathave dimensions (B, C, (Z), Y, X), where B is batch size.Returns-------list of numpy.ndarrayA list of ... | 1 | 4 | 1 | 51 | 1 | 163 | 180 | 163 | predictions | ['prediction_split'] | list[NDArray] | {"AnnAssign": 1, "Assign": 1, "Expr": 1, "Return": 1} | 2 | 18 | 2 | ["np.concatenate", "np.split"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.prediction_outputs_py._combine_tiled_batches", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.pr... | The function (_combine_array_batches) defined within the public class called public.The function start at line 163 and ends at 180. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 function... |
CAREamics_careamics | public | public | 0 | 0 | stitch_prediction_vae | def stitch_prediction_vae(predictions, dset):"""Stitch predictions back together using dataset's index manager.Args:predictions: Array of predictions with shape (n_tiles, channels, height, width)dset: Dataset object with idx_manager containing tiling information"""mng = dset.idx_manager# if there are more channels, use... | 11 | 37 | 2 | 440 | 11 | 20 | 80 | 20 | predictions,dset | ['output', 'gs', 'pe', 'rs', 'shape', 'vgs', 'mng', 'ge', 'ps', 're', 'vge'] | Returns | {"Assign": 16, "Expr": 1, "For": 3, "If": 5, "Return": 1} | 19 | 61 | 19 | ["list", "dset.get_data_shape", "max", "np.zeros", "range", "np.array", "mng.get_location_from_dataset_idx", "mng.patch_offset", "np.array", "max", "np.array", "min", "zip", "range", "len", "range", "len", "len", "ValueError"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.prediction_outputs_py.convert_outputs_microsplit"] | The function (stitch_prediction_vae) defined within the public class called public.The function start at line 20 and ends at 80. It contains 37 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [20.0], and this function return a value. It declares 19.0 functions, It has 19.0 ... |
CAREamics_careamics | public | public | 0 | 0 | stitch_prediction | def stitch_prediction(tiles: list[np.ndarray],tile_infos: list[TileInformation],) -> list[np.ndarray]:"""Stitch tiles back together to form a full image(s).Tiles are of dimensions SC(Z)YX, where C is the number of channels and can be asingleton dimension.Parameters----------tiles : list of numpy.ndarrayCropped tiles an... | 5 | 18 | 2 | 116 | 4 | 84 | 124 | 84 | tiles,tile_infos | ['image_predictions', 'last_tiles', 'last_tile_position', 'image_slices'] | list[np.ndarray] | {"Assign": 4, "Expr": 2, "For": 1, "Return": 1} | 6 | 41 | 6 | ["np.where", "slice", "range", "len", "image_predictions.append", "stitch_prediction_single"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.prediction_utils.prediction_outputs_py.convert_outputs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.dataset.tiling.test_lvae_tiled_pat... | The function (stitch_prediction) defined within the public class called public.The function start at line 84 and ends at 124. It contains 18 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [84.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions ... |
CAREamics_careamics | public | public | 0 | 0 | stitch_prediction_single | def stitch_prediction_single(tiles: list[NDArray],tile_infos: list[TileInformation],) -> NDArray:"""Stitch tiles back together to form a full image.Tiles are of dimensions SC(Z)YX, where C is the number of channels and can be asingleton dimension.Parameters----------tiles : list of numpy.ndarrayCropped tiles and their ... | 6 | 23 | 2 | 218 | 5 | 127 | 183 | 127 | tiles,tile_infos | ['predicted_image', 'tile_channels', 'input_shape', 'image_slices', 'cropped_tile'] | NDArray | {"AnnAssign": 1, "Assign": 7, "Expr": 1, "For": 1, "If": 2, "Return": 1} | 9 | 57 | 9 | ["len", "len", "ValueError", "len", "np.zeros", "zip", "slice", "slice", "cropped_tile.astype"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.callbacks.prediction_writer_callback.write_strategy_py.CacheTiles.write_batch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.car... | The function (stitch_prediction_single) defined within the public class called public.The function start at line 127 and ends at 183. It contains 23 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [127.0] and does not return any value. It declares 9.0 functions, It has 9.0 f... |
CAREamics_careamics | public | public | 0 | 0 | get_all_transforms | def get_all_transforms() -> dict[str, type]:"""Return all the transforms accepted by CAREamics.Returns-------dictA dictionary with all the transforms accepted by CAREamics, where the keys arethe transform names and the values are the transform classes."""return ALL_TRANSFORMS | 1 | 2 | 0 | 14 | 0 | 21 | 30 | 21 | [] | dict[str, type] | {"Expr": 1, "Return": 1} | 0 | 10 | 0 | [] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.compose_py.Compose.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.config.data.test_data_model_py.test_passing_incorr... | The function (get_all_transforms) defined within the public class called public.The function start at line 21 and ends at 30. 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 3.0 functions calling this function which are... | |
CAREamics_careamics | Compose | public | 0 | 0 | __init__ | def __init__(self, transform_list: list[NORM_AND_SPATIAL_UNION]) -> None:"""Instantiate a Compose object.Parameters----------transform_list : list[NORM_AND_SPATIAL_UNION]A list of dictionaries where each dictionary contains the name of atransform and its parameters."""# retrieve all available transforms# TODO: correctl... | 2 | 5 | 2 | 59 | 0 | 48 | 64 | 48 | self,transform_list | [] | None | {"AnnAssign": 2, "Expr": 1} | 2 | 17 | 2 | ["get_all_transforms", "t.model_dump"] | 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 Compose.The function start at line 48 and ends at 64. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [48.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called ins... |
CAREamics_careamics | Compose | public | 0 | 0 | _chain_transforms | def _chain_transforms(self, patch: NDArray, target: NDArray | None) -> tuple[NDArray | None, ...]:"""Chain transforms on the input data.Parameters----------patch : np.ndarrayInput data.target : Optional[np.ndarray]Target data, by default None.Returns-------tuple[np.ndarray, Optional[np.ndarray]]The output of the transf... | 4 | 7 | 3 | 76 | 0 | 66 | 90 | 66 | self,patch,target | [] | tuple[NDArray | None, ...] | {"AnnAssign": 1, "Assign": 1, "Expr": 1, "For": 1, "Return": 1} | 2 | 25 | 2 | ["t", "tuple"] | 0 | [] | The function (_chain_transforms) defined within the public class called Compose.The function start at line 66 and ends at 90. It contains 7 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [66.0] and does not return any value. It declares 2.0 functions, and It has 2.0 functi... |
CAREamics_careamics | Compose | public | 0 | 0 | _chain_transforms_additional_arrays | def _chain_transforms_additional_arrays(self,patch: NDArray,target: NDArray | None,**additional_arrays: NDArray,) -> tuple[NDArray, NDArray | None, dict[str, NDArray]]:"""Chain transforms on the input data, with additional arrays.Parameters----------patch : np.ndarrayInput data.target : Optional[np.ndarray]Target data,... | 2 | 11 | 4 | 90 | 0 | 92 | 121 | 92 | self,patch,target,**additional_arrays | [] | tuple[NDArray, NDArray | None, dict[str, NDArray]] | {"Assign": 3, "Expr": 1, "For": 1, "Return": 1} | 1 | 30 | 1 | ["t"] | 0 | [] | The function (_chain_transforms_additional_arrays) defined within the public class called Compose.The function start at line 92 and ends at 121. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [92.0] and does not return any value. It declare 1.0 function, and ... |
CAREamics_careamics | Compose | public | 0 | 0 | __call__ | def __call__(self, patch: NDArray, target: NDArray | None = None) -> tuple[NDArray, ...]:"""Apply the transforms to the input data.Parameters----------patch : np.ndarrayThe input data.target : Optional[np.ndarray], optionalTarget data, by default None.Returns-------tuple[np.ndarray, ...]The output of the transformation... | 1 | 4 | 3 | 44 | 0 | 123 | 141 | 123 | self,patch,target | [] | tuple[NDArray, ...] | {"Expr": 1, "Return": 1} | 2 | 19 | 2 | ["cast", "self._chain_transforms"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called Compose.The function start at line 123 and ends at 141. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [123.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called ... |
CAREamics_careamics | Compose | public | 0 | 0 | transform_with_additional_arrays | def transform_with_additional_arrays(self,patch: NDArray,target: NDArray | None = None,**additional_arrays: NDArray,) -> tuple[NDArray, NDArray | None, dict[str, NDArray]]:"""Apply the transforms to the input data, including additional arrays.Parameters----------patch : np.ndarrayThe input data.target : Optional[np.nda... | 1 | 9 | 4 | 52 | 0 | 143 | 173 | 143 | self,patch,target,**additional_arrays | [] | tuple[NDArray, NDArray | None, dict[str, NDArray]] | {"Expr": 1, "Return": 1} | 1 | 31 | 1 | ["self._chain_transforms_additional_arrays"] | 0 | [] | The function (transform_with_additional_arrays) defined within the public class called Compose.The function start at line 143 and ends at 173. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [143.0] and does not return any value. It declare 1.0 function, and I... |
CAREamics_careamics | N2VManipulate | public | 0 | 1 | __init__ | def __init__(self,roi_size: int = 11,masked_pixel_percentage: float = 0.2,strategy: Literal["uniform", "median"] = SupportedPixelManipulation.UNIFORM.value,remove_center: bool = True,struct_mask_axis: Literal["horizontal", "vertical", "none"] = "none",struct_mask_span: int = 5,seed: int | None = None,):"""Constructor.P... | 3 | 24 | 8 | 144 | 0 | 54 | 99 | 54 | self,roi_size,masked_pixel_percentage,strategy,remove_center,struct_mask_axis,struct_mask_span,seed | [] | None | {"AnnAssign": 1, "Assign": 6, "Expr": 1, "If": 1} | 2 | 46 | 2 | ["StructMaskParameters", "np.random.default_rng"] | 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 N2VManipulate, that inherit another class.The function start at line 54 and ends at 99. It contains 24 lines of code and it has a cyclomatic complexity of 3. It takes 8 parameters, represented as [54.0] and does not return any value. It declares 2.0 functio... |
CAREamics_careamics | N2VManipulate | public | 0 | 1 | __call__ | def __call__(self, patch: NDArray, *args: Any, **kwargs: Any) -> tuple[NDArray, NDArray, NDArray]:"""Apply the transform to the image.Parameters----------patch : np.ndarrayImage patch, 2D or 3D, shape C(Z)YX.*args : AnyAdditional arguments, unused.**kwargs : AnyAdditional keyword arguments, unused.Returns-------tuple[n... | 5 | 27 | 4 | 209 | 0 | 101 | 150 | 101 | self,patch,*args,**kwargs | [] | tuple[NDArray, NDArray, NDArray] | {"Assign": 4, "Expr": 1, "For": 2, "If": 2, "Return": 1} | 7 | 50 | 7 | ["np.zeros_like", "np.zeros_like", "range", "uniform_manipulate", "range", "median_manipulate", "ValueError"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called N2VManipulate, that inherit another class.The function start at line 101 and ends at 150. It contains 27 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [101.0] and does not return any value. It declares 7.0 func... |
CAREamics_careamics | N2VManipulateTorch | public | 0 | 0 | __init__ | def __init__(self,n2v_manipulate_config: N2VManipulateModel,seed: int | None = None,device: str | None = None,):"""Constructor.Parameters----------n2v_manipulate_config : N2VManipulateModelN2V manipulation configuration.seed : Optional[int], optionalRandom seed, by default None.device : strThe device on which operation... | 8 | 37 | 4 | 186 | 0 | 49 | 101 | 49 | self,n2v_manipulate_config,seed,device | [] | None | {"AnnAssign": 1, "Assign": 9, "Expr": 1, "If": 4} | 7 | 53 | 7 | ["StructMaskParameters", "torch.cuda.is_available", "torch.backends.mps.is_available", "platform.processor", "manual_seed", "torch.Generator", "torch.Generator"] | 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 N2VManipulateTorch.The function start at line 49 and ends at 101. It contains 37 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [49.0] and does not return any value. It declares 7.0 functions, It has 7.0 functio... |
CAREamics_careamics | N2VManipulateTorch | public | 0 | 0 | __call__ | def __call__(self, batch: torch.Tensor, *args: Any, **kwargs: Any) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:"""Apply the transform to the image.Parameters----------batch : torch.TensorBatch if image patches, 2D or 3D, shape BC(Z)YX.*args : AnyAdditional arguments, unused.**kwargs : AnyAdditional keyword argum... | 5 | 27 | 4 | 235 | 0 | 103 | 149 | 103 | self,batch,*args,**kwargs | [] | tuple[torch.Tensor, torch.Tensor, torch.Tensor] | {"Assign": 4, "Expr": 1, "For": 2, "If": 2, "Return": 1} | 7 | 47 | 7 | ["torch.zeros_like", "torch.zeros_like", "range", "uniform_manipulate_torch", "range", "median_manipulate_torch", "ValueError"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called N2VManipulateTorch.The function start at line 103 and ends at 149. It contains 27 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [103.0] and does not return any value. It declares 7.0 functions, It has 7.0 funct... |
CAREamics_careamics | public | public | 0 | 0 | _reshape_stats | def _reshape_stats(stats: list[float], ndim: int) -> NDArray:"""Reshape stats to match the number of dimensions of the input image.This allows to broadcast the stats (mean or std) to the image dimensions, andthus directly perform a vectorial calculation.Parameters----------stats : list of floatList of stats, mean or st... | 1 | 2 | 2 | 42 | 0 | 9 | 27 | 9 | stats,ndim | [] | NDArray | {"Expr": 1, "Return": 1} | 1 | 19 | 1 | ["np.array"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.normalize_py.Denormalize.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.normalize_py.Normalize.__... | The function (_reshape_stats) defined within the public class called public.The function start at line 9 and ends at 27. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [9.0] and does not return any value. It declare 1.0 function, It has 1.0 function called ins... |
CAREamics_careamics | Normalize | public | 0 | 1 | __init__ | def __init__(self,image_means: list[float],image_stds: list[float],target_means: list[float] | None = None,target_stds: list[float] | None = None,):"""Constructor.Parameters----------image_means : list of floatMean value per channel.image_stds : list of floatStandard deviation value per channel.target_means : list of f... | 1 | 12 | 5 | 70 | 0 | 63 | 88 | 63 | self,image_means,image_stds,target_means,target_stds | [] | None | {"Assign": 5, "Expr": 1} | 0 | 26 | 0 | [] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called Normalize, that inherit another class.The function start at line 63 and ends at 88. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [63.0] and does not return any value. It has 8182.0 functions cal... |
CAREamics_careamics | Normalize | public | 0 | 1 | __call__ | def __call__(self,patch: np.ndarray,target: NDArray | None = None,**additional_arrays: NDArray,) -> tuple[NDArray, NDArray | None, dict[str, NDArray]]:"""Apply the transform to the source patch and the target (optional).Parameters----------patch : NDArrayPatch, 2D or 3D, shape C(Z)YX.target : NDArray, optionalTarget fo... | 9 | 41 | 4 | 230 | 0 | 90 | 152 | 90 | self,patch,target,**additional_arrays | [] | tuple[NDArray, NDArray | None, dict[str, NDArray]] | {"Assign": 7, "Expr": 1, "If": 6, "Return": 1} | 17 | 63 | 17 | ["len", "ValueError", "len", "len", "NotImplementedError", "_reshape_stats", "_reshape_stats", "self._apply", "ValueError", "len", "len", "ValueError", "len", "ValueError", "_reshape_stats", "_reshape_stats", "self._apply"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called Normalize, that inherit another class.The function start at line 90 and ends at 152. It contains 41 lines of code and it has a cyclomatic complexity of 9. It takes 4 parameters, represented as [90.0] and does not return any value. It declares 17.0 functions... |
CAREamics_careamics | Normalize | public | 0 | 1 | _apply | def _apply(self, patch: NDArray, mean: NDArray, std: NDArray) -> NDArray:"""Apply the transform to the image.Parameters----------patch : NDArrayImage patch, 2D or 3D, shape C(Z)YX.mean : NDArrayMean values.std : NDArrayStandard deviations.Returns-------NDArrayNormalized image patch."""return ((patch - mean) / (std + se... | 1 | 2 | 4 | 43 | 0 | 154 | 172 | 154 | self,patch,mean,std | [] | NDArray | {"Expr": 1, "Return": 1} | 1 | 19 | 1 | ["astype"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq.utils_py.apply_to_sample", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70411573_eleutherai_oslo.oslo.lightseq2.csrc.pytorch.pytorch_quantization.nn.modules.quant_rnn_py.Qua... | The function (_apply) defined within the public class called Normalize, that inherit another class.The function start at line 154 and ends at 172. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [154.0] and does not return any value. It declare 1.0 function, It... |
CAREamics_careamics | Normalize | public | 0 | 1 | __init__ | def __init__(self,image_means: list[float],image_stds: list[float],):"""Constructor.Parameters----------image_means : list of floatMean value per channel.image_stds : list of floatStandard deviation value per channel."""self.image_means = image_meansself.image_stds = image_stdsself.eps = 1e-6 | 1 | 8 | 3 | 38 | 0 | 195 | 212 | 195 | self,image_means,image_stds,target_means,target_stds | [] | None | {"Assign": 5, "Expr": 1} | 0 | 26 | 0 | [] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called Normalize, that inherit another class.The function start at line 195 and ends at 212. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [195.0] and does not return any value. It has 8182.0 functions c... |
CAREamics_careamics | Normalize | public | 0 | 1 | __call__ | def __call__(self, patch: NDArray) -> NDArray:"""Reverse the normalization operation for a batch of patches.Parameters----------patch : NDArrayPatch, 2D or 3D, shape BC(Z)YX.Returns-------NDArrayTransformed array."""if len(self.image_means) != patch.shape[1]:raise ValueError(f"Number of means (got a list of size {len(s... | 2 | 15 | 2 | 101 | 0 | 214 | 243 | 214 | self,patch,target,**additional_arrays | [] | tuple[NDArray, NDArray | None, dict[str, NDArray]] | {"Assign": 7, "Expr": 1, "If": 6, "Return": 1} | 17 | 63 | 17 | ["len", "ValueError", "len", "len", "NotImplementedError", "_reshape_stats", "_reshape_stats", "self._apply", "ValueError", "len", "len", "ValueError", "len", "ValueError", "_reshape_stats", "_reshape_stats", "self._apply"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called Normalize, that inherit another class.The function start at line 214 and ends at 243. It contains 15 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [214.0] and does not return any value. It declares 17.0 functio... |
CAREamics_careamics | Normalize | public | 0 | 1 | _apply | def _apply(self, array: NDArray, mean: NDArray, std: NDArray) -> NDArray:"""Apply the transform to the image.Parameters----------array : NDArrayImage patch, 2D or 3D, shape C(Z)YX.mean : NDArrayMean values.std : NDArrayStandard deviations.Returns-------NDArrayDenormalized image array."""return array * (std + self.eps) ... | 1 | 2 | 4 | 32 | 0 | 245 | 263 | 245 | self,patch,mean,std | [] | NDArray | {"Expr": 1, "Return": 1} | 1 | 19 | 1 | ["astype"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq.utils_py.apply_to_sample", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70411573_eleutherai_oslo.oslo.lightseq2.csrc.pytorch.pytorch_quantization.nn.modules.quant_rnn_py.Qua... | The function (_apply) defined within the public class called Normalize, that inherit another class.The function start at line 245 and ends at 263. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [245.0] and does not return any value. It declare 1.0 function, It... |
CAREamics_careamics | public | public | 0 | 0 | _apply_struct_mask | def _apply_struct_mask(patch: np.ndarray,coords: np.ndarray,struct_params: StructMaskParameters,rng: np.random.Generator | None = None,) -> np.ndarray:"""Apply structN2V masks to patch.Each point in `coords` corresponds to the center of a mask, masks are paremeterizedby `struct_params` and pixels in the mask (with resp... | 2 | 23 | 4 | 284 | 7 | 13 | 78 | 13 | patch,coords,struct_params,rng | ['max_bound', 'mix', 'dx', 'mask', 'rng', 'center', 'moving_axis'] | np.ndarray | {"Assign": 13, "Expr": 1, "If": 1, "Return": 1} | 18 | 66 | 18 | ["np.random.default_rng", "np.expand_dims", "np.ones", "list", "range", "len", "np.moveaxis", "np.array", "tuple", "np.indices", "reshape", "mix.transpose", "np.delete", "np.delete", "tuple", "rng.uniform", "patch.min", "patch.max"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_py.median_manipulate", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_... | The function (_apply_struct_mask) defined within the public class called public.The function start at line 13 and ends at 78. It contains 23 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [13.0] and does not return any value. It declares 18.0 functions, It has 18.0 function... |
CAREamics_careamics | public | public | 0 | 0 | _odd_jitter_func | def _odd_jitter_func(step: float, rng: np.random.Generator) -> np.ndarray:"""Randomly sample a jitter to be applied to the masking grid.This is done to account for cases where the step size is not an integer.Parameters----------step : floatStep size of the grid, output of np.linspace.rng : np.random.GeneratorRandom num... | 2 | 3 | 2 | 64 | 1 | 81 | 103 | 81 | step,rng | ['odd_jitter'] | np.ndarray | {"Assign": 1, "Expr": 1, "Return": 1} | 5 | 23 | 5 | ["np.where", "np.floor", "rng.integers", "np.floor", "np.ceil"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_py._get_stratified_coords"] | The function (_odd_jitter_func) defined within the public class called public.The function start at line 81 and ends at 103. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [81.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions ca... |
CAREamics_careamics | public | public | 0 | 0 | _get_stratified_coords | def _get_stratified_coords(mask_pixel_perc: float,shape: tuple[int, ...],rng: np.random.Generator | None = None,) -> np.ndarray:"""Generate coordinates of the pixels to mask.Randomly selects the coordinates of the pixels to mask in a stratified way, i.e.the distance between masked pixels is approximately the same.Param... | 5 | 35 | 3 | 264 | 8 | 106 | 170 | 106 | mask_pixel_perc,shape,rng | ['pixel_coords', 'grid_random_increment', 'num_pixels', 'steps', 'coordinate_grid', 'mask_pixel_distance', 'rng', 'coordinate_grid_list'] | np.ndarray | {"Assign": 10, "AugAssign": 1, "Expr": 3, "For": 1, "If": 2, "Return": 1} | 24 | 65 | 24 | ["len", "len", "ValueError", "np.random.default_rng", "astype", "np.round", "len", "int", "np.ceil", "np.linspace", "pixel_coords.append", "steps.append", "np.meshgrid", "reshape", "np.array", "len", "rng.integers", "_odd_jitter_func", "float", "max", "astype", "np.ones_like", "np.clip", "np.array"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_py.median_manipulate", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_... | The function (_get_stratified_coords) defined within the public class called public.The function start at line 106 and ends at 170. It contains 35 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [106.0] and does not return any value. It declares 24.0 functions, It has 24.0 f... |
CAREamics_careamics | public | public | 0 | 0 | _create_subpatch_center_mask | def _create_subpatch_center_mask(subpatch: np.ndarray, center_coords: np.ndarray) -> np.ndarray:"""Create a mask with the center of the subpatch masked.Parameters----------subpatch : np.ndarraySubpatch to be manipulated.center_coords : np.ndarrayCoordinates of the original center before possible crop.Returns-------np.n... | 1 | 6 | 2 | 48 | 1 | 173 | 192 | 173 | subpatch,center_coords | ['mask'] | np.ndarray | {"Assign": 2, "Expr": 1, "Return": 1} | 3 | 20 | 3 | ["np.ones", "tuple", "np.ma.make_mask"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_py.median_manipulate"] | The function (_create_subpatch_center_mask) defined within the public class called public.The function start at line 173 and ends at 192. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [173.0] and does not return any value. It declares 3.0 functions, It has 3.... |
CAREamics_careamics | public | public | 0 | 0 | _create_subpatch_struct_mask | def _create_subpatch_struct_mask(subpatch: np.ndarray, center_coords: np.ndarray, struct_params: StructMaskParameters) -> np.ndarray:"""Create a structN2V mask for the subpatch.Parameters----------subpatch : np.ndarraySubpatch to be manipulated.center_coords : np.ndarrayCoordinates of the original center before possibl... | 1 | 15 | 3 | 140 | 4 | 195 | 234 | 195 | subpatch,center_coords,struct_params | ['mask', 'mask_index', 'mask_reshaped', 'mask_placeholder'] | np.ndarray | {"Assign": 5, "Expr": 1, "Return": 1} | 9 | 40 | 9 | ["np.ones", "np.moveaxis", "slice", "max", "center_coords.take", "min", "center_coords.take", "np.moveaxis", "np.ma.make_mask"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_py.median_manipulate"] | The function (_create_subpatch_struct_mask) defined within the public class called public.The function start at line 195 and ends at 234. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [195.0] and does not return any value. It declares 9.0 functions, It has 9... |
CAREamics_careamics | public | public | 0 | 0 | uniform_manipulate | def uniform_manipulate(patch: np.ndarray,mask_pixel_percentage: float,subpatch_size: int = 11,remove_center: bool = True,struct_params: StructMaskParameters | None = None,rng: np.random.Generator | None = None,) -> tuple[np.ndarray, np.ndarray]:"""Manipulate pixels by replacing them with a neighbor values.Manipulated p... | 5 | 33 | 6 | 259 | 9 | 237 | 315 | 237 | patch,mask_pixel_percentage,subpatch_size,remove_center,struct_params,rng | ['transformed_patch', 'replacement_coords', 'subpatch_centers', 'roi_span_full', 'roi_span', 'replacement_pixels', 'rng', 'mask', 'random_increment'] | tuple[np.ndarray, np.ndarray] | {"Assign": 11, "Expr": 1, "If": 2, "Return": 1} | 18 | 79 | 18 | ["np.random.default_rng", "patch.copy", "_get_stratified_coords", "astype", "np.arange", "np.floor", "np.ceil", "rng.choice", "np.clip", "range", "len", "tuple", "replacement_coords.T.tolist", "tuple", "subpatch_centers.T.tolist", "astype", "np.where", "_apply_struct_mask"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.n2v_manipulate_py.N2VManipulate.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.transforms.test_pixel_manipulation_py... | The function (uniform_manipulate) defined within the public class called public.The function start at line 237 and ends at 315. It contains 33 lines of code and it has a cyclomatic complexity of 5. It takes 6 parameters, represented as [237.0] and does not return any value. It declares 18.0 functions, It has 18.0 funct... |
CAREamics_careamics | public | public | 0 | 0 | median_manipulate | def median_manipulate(patch: np.ndarray,mask_pixel_percentage: float,subpatch_size: int = 11,struct_params: StructMaskParameters | None = None,rng: np.random.Generator | None = None,) -> tuple[np.ndarray, np.ndarray]:"""Manipulate pixels by replacing them with the median of their surrounding subpatch.N2V2 version, mani... | 7 | 48 | 5 | 359 | 12 | 318 | 406 | 318 | patch,mask_pixel_percentage,subpatch_size,struct_params,rng | ['idxs', 'subpatch_coords', 'subpatch_crops_span_clipped', 'transformed_patch', 'subpatch', 'subpatch_center_adjusted', 'subpatch_centers', 'roi_span', 'mask', 'rng', 'subpatch_crops_span_full', 'subpatch_mask'] | tuple[np.ndarray, np.ndarray] | {"Assign": 15, "Expr": 1, "For": 1, "If": 3, "Return": 1} | 21 | 89 | 21 | ["np.random.default_rng", "patch.copy", "_get_stratified_coords", "astype", "np.array", "np.floor", "np.ceil", "np.clip", "np.zeros_like", "np.array", "range", "slice", "slice", "tuple", "_create_subpatch_center_mask", "_create_subpatch_struct_mask", "tuple", "np.median", "astype", "np.where", "_apply_struct_mask"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.n2v_manipulate_py.N2VManipulate.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.transforms.test_pixel_manipulation_py... | The function (median_manipulate) defined within the public class called public.The function start at line 318 and ends at 406. It contains 48 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [318.0] and does not return any value. It declares 21.0 functions, It has 21.0 functi... |
CAREamics_careamics | public | public | 0 | 0 | _apply_struct_mask_torch | def _apply_struct_mask_torch(patch: torch.Tensor,coords: torch.Tensor,struct_params: StructMaskParameters,rng: torch.Generator | None = None,) -> torch.Tensor:"""Apply structN2V masks to patch.Each point in `coords` corresponds to the center of a mask. Masks are parameterizedby `struct_params`, and pixels in the mask (... | 2 | 26 | 4 | 285 | 9 | 8 | 73 | 8 | patch,coords,struct_params,rng | ['displacements', 'valid_indices', 'mask_shape', 'mix', 'mask', 'rng', 'center', 'random_values', 'moving_axis'] | torch.Tensor | {"Assign": 14, "Expr": 1, "If": 1, "Return": 1} | 21 | 66 | 21 | ["torch.Generator", "len", "torch.ones", "torch.tensor", "tuple", "torch.stack", "torch.where", "center.unsqueeze", "displacements.T.unsqueeze", "coords.T.unsqueeze", "reshape", "mix.permute", "uniform_", "torch.empty", "len", "item", "patch.min", "item", "patch.max", "tuple", "mix.T.tolist"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_torch_py.median_manipulate_torch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_m... | The function (_apply_struct_mask_torch) defined within the public class called public.The function start at line 8 and ends at 73. It contains 26 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [8.0] and does not return any value. It declares 21.0 functions, It has 21.0 func... |
CAREamics_careamics | public | public | 0 | 0 | _get_stratified_coords_torch | def _get_stratified_coords_torch(mask_pixel_perc: float,shape: tuple[int, ...],rng: torch.Generator,) -> torch.Tensor:"""Generate coordinates of the pixels to mask.Randomly selects the coordinates of the pixels to mask in a stratified way, i.e.the distance between masked pixels is approximately the same. This is achiev... | 2 | 31 | 3 | 260 | 9 | 76 | 147 | 76 | mask_pixel_perc,shape,rng | ['spatial_shape', 'offset', 'grid_size', 'expected_area_per_pixel', 'grid_dims', 'out_of_bounds', 'n_dims', 'batch_size', 'coords'] | torch.Tensor | {"Assign": 12, "AugAssign": 1, "Expr": 1, "Return": 1} | 19 | 72 | 19 | ["len", "int", "torch.ceil", "torch.tensor", "reshape", "torch.stack", "torch.meshgrid", "torch.arange", "torch.arange", "item", "range", "torch.rand", "len", "coords.to", "int", "torch.floor", "any", "reshape", "torch.tensor"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_manipulation_torch_py.median_manipulate_torch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.pixel_m... | The function (_get_stratified_coords_torch) defined within the public class called public.The function start at line 76 and ends at 147. It contains 31 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [76.0] and does not return any value. It declares 19.0 functions, It has 19... |
CAREamics_careamics | public | public | 0 | 0 | uniform_manipulate_torch | def uniform_manipulate_torch(patch: torch.Tensor,mask_pixel_percentage: float,subpatch_size: int = 11,remove_center: bool = True,struct_params: StructMaskParameters | None = None,rng: torch.Generator | None = None,) -> tuple[torch.Tensor, torch.Tensor]:"""Manipulate pixels by replacing them with a neighbor values.# TOD... | 5 | 45 | 6 | 344 | 9 | 150 | 250 | 150 | patch,mask_pixel_percentage,subpatch_size,remove_center,struct_params,rng | ['transformed_patch', 'replacement_coords', 'subpatch_centers', 'roi_span_full', 'roi_span', 'replacement_pixels', 'rng', 'mask', 'random_increment'] | tuple[torch.Tensor, torch.Tensor] | {"Assign": 13, "Expr": 1, "If": 2, "Return": 1} | 19 | 101 | 19 | ["torch.Generator", "patch.clone", "_get_stratified_coords_torch", "subpatch_centers.to", "torch.arange", "torch.randint", "min", "max", "subpatch_centers.clone", "torch.clamp", "to", "torch.zeros_like", "torch.tensor", "to", "torch.tensor", "tuple", "tuple", "to", "_apply_struct_mask_torch"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.n2v_manipulate_torch_py.N2VManipulateTorch.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.transforms.test_pixel_mani... | The function (uniform_manipulate_torch) defined within the public class called public.The function start at line 150 and ends at 250. It contains 45 lines of code and it has a cyclomatic complexity of 5. It takes 6 parameters, represented as [150.0] and does not return any value. It declares 19.0 functions, It has 19.0... |
CAREamics_careamics | public | public | 0 | 0 | median_manipulate_torch | def median_manipulate_torch(batch: torch.Tensor,mask_pixel_percentage: float,subpatch_size: int = 11,struct_params: StructMaskParameters | None = None,rng: torch.Generator | None = None,) -> tuple[torch.Tensor, torch.Tensor]:"""Manipulate pixels by replacing them with the median of their surrounding subpatch.N2V2 versi... | 8 | 76 | 5 | 483 | 15 | 253 | 383 | 253 | batch,mask_pixel_percentage,subpatch_size,struct_params,rng | ['coords_axes', 'coords_expands', 'rois_filtered', 'pad_value', 'span_axis', 'center_axis', 'subpatch_center_coordinates', 'offsets', 'medians', 'output_batch', 'mask', 'center_idx', 'rois', 'halfspan', 'struct_mask'] | tuple[torch.Tensor, torch.Tensor] | {"Assign": 23, "Expr": 4, "For": 1, "If": 4, "Return": 1} | 27 | 131 | 27 | ["to", "_get_stratified_coords_torch", "torch.meshgrid", "torch.arange", "range", "torch.stack", "axis_offset.flatten", "range", "coords_axes.append", "coords_expands.append", "expand", "unsqueeze", "coords_expands.append", "clamp", "unsqueeze", "tuple", "torch.meshgrid", "torch.arange", "torch.arange", "flatten", "tor... | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.transforms.n2v_manipulate_torch_py.N2VManipulateTorch.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.transforms.test_pixel_mani... | The function (median_manipulate_torch) defined within the public class called public.The function start at line 253 and ends at 383. It contains 76 lines of code and it has a cyclomatic complexity of 8. It takes 5 parameters, represented as [253.0] and does not return any value. It declares 27.0 functions, It has 27.0 ... |
CAREamics_careamics | Transform | public | 0 | 0 | __call__ | def __call__(self, *args: Any, **kwargs: Any) -> Any:"""Apply the transform.Parameters----------*args : AnyArguments.**kwargs : AnyKeyword arguments.Returns-------AnyTransformed data."""pass | 1 | 2 | 3 | 19 | 0 | 9 | 24 | 9 | self,*args,**kwargs | [] | Any | {"Expr": 1} | 0 | 16 | 0 | [] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called Transform.The function start at line 9 and ends at 24. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [9.0] and does not return any value. It has 59.0 functions calling this function which are ["_.... |
CAREamics_careamics | ImageRestorationTTA | public | 0 | 0 | forward | def forward(self, input_tensor: Tensor) -> list[Tensor]:"""Apply test-time augmentation to the input tensor.Parameters----------input_tensor : TensorInput tensor, shape SC(Z)YX.Returns-------list of torch.TensorList of augmented tensors."""# axes: only applies to YX axesaxes = (-2, -1)augmented = [# originalinput_tenso... | 1 | 17 | 2 | 138 | 0 | 19 | 56 | 19 | self,input_tensor | [] | list[Tensor] | {"Assign": 2, "Expr": 2, "Return": 1} | 8 | 38 | 8 | ["rot90", "rot90", "rot90", "flip", "flip", "augmented.extend", "flip", "flip"] | 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 ImageRestorationTTA.The function start at line 19 and ends at 56. It contains 17 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 declares 8.0 functions, It has 8.0 function... |
CAREamics_careamics | ImageRestorationTTA | public | 0 | 0 | backward | def backward(self, x: list[Tensor]) -> Tensor:"""Undo the test-time augmentation.Parameters----------x : AnyList of augmented tensors of shape SC(Z)YX.Returns-------AnyOriginal tensor."""axes = (-2, -1)reverse = [# originalx[0],# rotatedrot90(x[1], -1, dims=axes),rot90(x[2], -2, dims=axes),rot90(x[3], -3, dims=axes),# ... | 1 | 13 | 2 | 182 | 0 | 58 | 88 | 58 | self,x | [] | Tensor | {"Assign": 2, "Expr": 1, "Return": 1} | 11 | 31 | 11 | ["rot90", "rot90", "rot90", "flip", "flip", "rot90", "flip", "rot90", "flip", "mean", "stack"] | 12 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3628201_chainer_onnx_chainer.onnx_chainer.export_testcase_py.export_testcase", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3968520_nanoporetech_bonito.bonito.training_py.Trainer.train_one_step", "_.content.gdrive.... | The function (backward) defined within the public class called ImageRestorationTTA.The function start at line 58 and ends at 88. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [58.0] and does not return any value. It declares 11.0 functions, It has 11.0 funct... |
CAREamics_careamics | XYFlip | public | 0 | 1 | __init__ | def __init__(self,flip_x: bool = True,flip_y: bool = True,p: float = 0.5,seed: int | None = None,) -> None:"""Constructor.Parameters----------flip_x : bool, optionalWhether to flip along the X axis, by default True.flip_y : bool, optionalWhether to flip along the Y axis, by default True.p : floatProbability of applying... | 7 | 18 | 5 | 112 | 0 | 39 | 77 | 39 | self,flip_x,flip_y,p,seed | [] | None | {"Assign": 3, "Expr": 3, "If": 4} | 5 | 39 | 5 | ["ValueError", "ValueError", "self.axis_indices.append", "self.axis_indices.append", "np.random.default_rng"] | 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 XYFlip, that inherit another class.The function start at line 39 and ends at 77. It contains 18 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [39.0] and does not return any value. It declares 5.0 functions, It ... |
CAREamics_careamics | XYFlip | public | 0 | 1 | __call__ | def __call__(self,patch: NDArray,target: NDArray | None = None,**additional_arrays: NDArray,) -> tuple[NDArray, NDArray | None, dict[str, NDArray]]:"""Apply the transform to the source patch and the target (optional).Parameters----------patch : np.ndarrayPatch, 2D or 3D, shape C(Z)YX.target : Optional[np.ndarray], opti... | 4 | 15 | 4 | 128 | 0 | 79 | 114 | 79 | self,patch,target,**additional_arrays | [] | tuple[NDArray, NDArray | None, dict[str, NDArray]] | {"Assign": 4, "Expr": 1, "If": 1, "Return": 2} | 6 | 36 | 6 | ["self.rng.random", "self.rng.choice", "self._apply", "self._apply", "self._apply", "additional_arrays.items"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called XYFlip, that inherit another class.The function start at line 79 and ends at 114. It contains 15 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [79.0] and does not return any value. It declares 6.0 functions, It... |
CAREamics_careamics | XYFlip | public | 0 | 1 | _apply | def _apply(self, patch: NDArray, axis: int) -> NDArray:"""Apply the transform to the image.Parameters----------patch : np.ndarrayImage patch, 2D or 3D, shape C(Z)YX.axis : intAxis to flip.Returns-------np.ndarrayFlipped image patch."""return np.ascontiguousarray(np.flip(patch, axis=axis)) | 1 | 2 | 3 | 32 | 0 | 116 | 131 | 116 | self,patch,axis | [] | NDArray | {"Expr": 1, "Return": 1} | 2 | 16 | 2 | ["np.ascontiguousarray", "np.flip"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq.utils_py.apply_to_sample", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70411573_eleutherai_oslo.oslo.lightseq2.csrc.pytorch.pytorch_quantization.nn.modules.quant_rnn_py.Qua... | The function (_apply) defined within the public class called XYFlip, that inherit another class.The function start at line 116 and ends at 131. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [116.0] and does not return any value. It declares 2.0 functions, It ... |
CAREamics_careamics | XYRandomRotate90 | public | 0 | 1 | __init__ | def __init__(self, p: float = 0.5, seed: int | None = None):"""Constructor.Parameters----------p : floatProbability of applying the transform, by default 0.5.seed : Optional[int]Random seed, by default None."""if p < 0 or p > 1:raise ValueError("Probability must be in [0, 1].")# probability to apply the transformself.p... | 3 | 5 | 3 | 55 | 0 | 31 | 48 | 31 | self,p,seed | [] | None | {"Assign": 2, "Expr": 1, "If": 1} | 2 | 18 | 2 | ["ValueError", "np.random.default_rng"] | 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 XYRandomRotate90, that inherit another class.The function start at line 31 and ends at 48. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [31.0] and does not return any value. It declares 2.0 funct... |
CAREamics_careamics | XYRandomRotate90 | public | 0 | 1 | __call__ | def __call__(self,patch: NDArray,target: NDArray | None = None,**additional_arrays: NDArray,) -> tuple[NDArray, NDArray | None, dict[str, NDArray]]:"""Apply the transform to the source patch and the target (optional).Parameters----------patch : np.ndarrayPatch, 2D or 3D, shape C(Z)YX.target : Optional[np.ndarray], opti... | 4 | 19 | 4 | 148 | 0 | 50 | 89 | 50 | self,patch,target,**additional_arrays | [] | tuple[NDArray, NDArray | None, dict[str, NDArray]] | {"Assign": 5, "Expr": 1, "If": 1, "Return": 2} | 7 | 40 | 7 | ["self.rng.random", "int", "self.rng.integers", "self._apply", "self._apply", "self._apply", "additional_arrays.items"] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called XYRandomRotate90, that inherit another class.The function start at line 50 and ends at 89. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [50.0] and does not return any value. It declares 7.0 func... |
CAREamics_careamics | XYRandomRotate90 | public | 0 | 1 | _apply | def _apply(self, patch: NDArray, n_rot: int, axes: tuple[int, int]) -> NDArray:"""Apply the transform to the image.Parameters----------patch : np.ndarrayImage or image patch, 2D or 3D, shape C(Z)YX.n_rot : intNumber of 90 degree rotations.axes : tuple[int, int]Axes along which to rotate the patch.Returns-------np.ndarr... | 1 | 2 | 4 | 45 | 0 | 91 | 108 | 91 | self,patch,n_rot,axes | [] | NDArray | {"Expr": 1, "Return": 1} | 2 | 18 | 2 | ["np.ascontiguousarray", "np.rot90"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq.utils_py.apply_to_sample", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70411573_eleutherai_oslo.oslo.lightseq2.csrc.pytorch.pytorch_quantization.nn.modules.quant_rnn_py.Qua... | The function (_apply) defined within the public class called XYRandomRotate90, that inherit another class.The function start at line 91 and ends at 108. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [91.0] and does not return any value. It declares 2.0 functi... |
CAREamics_careamics | public | public | 0 | 0 | autocorrelation | def autocorrelation(image: NDArray) -> NDArray:"""Compute the autocorrelation of an image.This method is used to explore spatial correlations in images,in particular in the noise.The autocorrelation is normalized to the zero-shift value, which is centered inthe resulting images.Parameters----------image : NDArrayInput ... | 1 | 8 | 1 | 83 | 1 | 7 | 40 | 7 | image | ['image'] | NDArray | {"Assign": 6, "Expr": 1, "Return": 1} | 6 | 34 | 6 | ["np.mean", "np.std", "np.fft.fftn", "np.abs", "np.fft.ifftn", "np.fft.fftshift"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3965453_johnveitch_cpnest.cpnest.nest2pos_py.acl", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.78400723_sagemath_sagetrac_mirror.src.sage.combinat.matrices.hadamard_matrix_py.construction_four_symbol_delta_code_I"... | The function (autocorrelation) defined within the public class called public.The function start at line 7 and ends at 40. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 functions called i... |
CAREamics_careamics | _ContainerEnum | protected | 0 | 1 | __contains__ | def __contains__(cls, item: Any) -> bool:"""Check if an item is in the Enum.Parameters----------item : AnyItem to check.Returns-------boolTrue if the item is in the Enum, False otherwise."""try:cls(item)except ValueError:return Falsereturn True | 2 | 6 | 2 | 25 | 0 | 10 | 27 | 10 | cls,item | [] | bool | {"Expr": 2, "Return": 2, "Try": 1} | 1 | 18 | 1 | ["cls"] | 24 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.store_py.AbstractStore.__contains__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3580082_pacificbiosciences_falcon.falcon_kit.functional_py.LowerDict.__contains__", "_.content.gdriv... | The function (__contains__) defined within the protected class called _ContainerEnum, that inherit another class.The function start at line 10 and ends at 27. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [10.0] and does not return any value. It declare 1.0 f... |
CAREamics_careamics | _ContainerEnum | protected | 0 | 1 | has_value | def has_value(cls, value: Any) -> bool:"""Check if a value is in the Enum.Parameters----------value : AnyValue to check.Returns-------boolTrue if the value is in the Enum, False otherwise."""return value in cls._value2member_map_ | 1 | 2 | 2 | 18 | 0 | 30 | 43 | 30 | cls,value | [] | bool | {"Expr": 1, "Return": 1} | 0 | 14 | 0 | [] | 0 | [] | The function (has_value) defined within the protected class called _ContainerEnum, that inherit another class.The function start at line 30 and ends at 43. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [30.0] and does not return any value.. |
CAREamics_careamics | public | public | 0 | 0 | get_careamics_home | def get_careamics_home() -> Path:"""Return the CAREamics home directory.CAREamics home directory is a hidden folder in home.Returns-------PathCAREamics home directory path."""home = Path.home() / ".careamics"if not home.exists():home.mkdir(parents=True, exist_ok=True)return home | 2 | 5 | 0 | 38 | 1 | 14 | 29 | 14 | ['home'] | Path | {"Assign": 1, "Expr": 2, "If": 1, "Return": 1} | 3 | 16 | 3 | ["Path.home", "home.exists", "home.mkdir"] | 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 (get_careamics_home) defined within the public class called public.The function start at line 14 and ends at 29. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions call... | |
CAREamics_careamics | public | public | 0 | 0 | cwd | def cwd(path: Union[str, Path]) -> Iterator[None]:"""Change the current working directory to the given path.This method can be used to generate files in a specific directory, once out of thecontext, the working directory is set back to the original one.Parameters----------path : Union[str,Path]New working directory pat... | 3 | 10 | 1 | 71 | 2 | 33 | 67 | 33 | path | ['old_pwd', 'path'] | Iterator[None] | {"Assign": 2, "Expr": 5, "If": 1, "Try": 1} | 7 | 35 | 7 | ["Path", "path.exists", "path.mkdir", "absolute", "Path", "os.chdir", "os.chdir"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3983384_thoth_station_kebechet.kebechet.managers.thoth_advise.thoth_advise_py.ThothAdviseManager._write_advise", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.model_io.bioi... | The function (cwd) defined within the public class called public.The function start at line 33 and ends at 67. It contains 10 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 inside whic... |
CAREamics_careamics | public | public | 0 | 0 | read_csv_logger | def read_csv_logger(experiment_name: str, log_folder: Union[str, Path]) -> dict:"""Return the loss curves from the csv logs.Parameters----------experiment_name : strName of the experiment.log_folder : Path or strPath to the folder containing the csv logs.Returns-------dictDictionary containing the loss curves, with key... | 14 | 40 | 2 | 340 | 11 | 7 | 71 | 7 | experiment_name,log_folder | ['header', 'val_losses', 'train_epoch', 'values', 'val_epoch', 'path_log', 'version', 'path', 'versions', 'train_losses', 'lines'] | dict | {"AnnAssign": 1, "Assign": 11, "Expr": 3, "For": 2, "Return": 1, "With": 1} | 27 | 65 | 27 | ["Path", "int", "v.name.split", "path.iterdir", "v.is_dir", "max", "open", "f.readlines", "split", "strip", "print", "split", "single_line.strip", "zip", "append", "int", "range", "len", "int", "range", "len", "float", "range", "len", "float", "range", "len"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.careamist_py.CAREamist.get_losses", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.utils.test_lightning_utils_py.test_read_logger"] | The function (read_csv_logger) defined within the public class called public.The function start at line 7 and ends at 71. It contains 40 lines of code and it has a cyclomatic complexity of 14. It takes 2 parameters, represented as [7.0] and does not return any value. It declares 27.0 functions, It has 27.0 functions ca... |
CAREamics_careamics | public | public | 0 | 0 | get_logger | def get_logger(name: str,log_level: int = logging.INFO,log_path: Union[str, Path] | None = None,) -> logging.Logger:"""Create a python logger instance with configured handlers.Parameters----------name : strName of the logger.log_level : int, optionalLog level (info, error etc.), by default logging.INFO.log_path : Optio... | 6 | 29 | 3 | 155 | 3 | 17 | 71 | 17 | name,log_level,log_path | ['formatter', 'handlers', 'logger'] | logging.Logger | {"Assign": 8, "Expr": 5, "For": 2, "If": 3, "Return": 3} | 10 | 55 | 10 | ["logging.getLogger", "name.startswith", "logging.StreamHandler", "logging.FileHandler", "logging.StreamHandler", "logging.Formatter", "handler.setFormatter", "handler.setLevel", "logger.addHandler", "logger.setLevel"] | 111 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3709684_cgat_developers_cgat_core.cgatcore.pipeline.cluster_py.DRMAACluster.collect_single_job_from_cluster", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3709684_cgat_developers_cgat_core.cgatcore.pipeline.cluster... | The function (get_logger) defined within the public class called public.The function start at line 17 and ends at 71. It contains 29 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [17.0] and does not return any value. It declares 10.0 functions, It has 10.0 functions called... |
CAREamics_careamics | ProgressBar | public | 0 | 0 | __init__ | def __init__(self,max_value: int | None = None,epoch: int | None = None,num_epochs: int | None = None,stateful_metrics: list | None = None,always_stateful: bool = False,mode: str = "train",) -> None:"""Constructor.Parameters----------max_value : Optional[int], optionalMaximum progress bar value, by default None.epoch :... | 12 | 36 | 7 | 247 | 0 | 98 | 159 | 98 | self,max_value,epoch,num_epochs,stateful_metrics,always_stateful,mode | [] | None | {"AnnAssign": 2, "Assign": 14, "Expr": 2, "If": 5} | 7 | 62 | 7 | ["print", "set", "set", "hasattr", "sys.stdout.isatty", "time.time", "self.spinning_cursor"] | 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 ProgressBar.The function start at line 98 and ends at 159. It contains 36 lines of code and it has a cyclomatic complexity of 12. It takes 7 parameters, represented as [98.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions cal... |
CAREamics_careamics | ProgressBar | public | 0 | 0 | update | def update(self, current_step: int, batch_size: int = 1, values: list | None = None) -> None:"""Update the progress bar.Parameters----------current_step : intIndex of the current step.batch_size : int, optionalBatch size, by default 1.values : Optional[list], optionalUpdated metrics values, by default None."""values = ... | 22 | 76 | 4 | 522 | 0 | 161 | 265 | 161 | self,current_step,batch_size,values | [] | None | {"Assign": 17, "AugAssign": 17, "Expr": 8, "For": 2, "If": 15} | 21 | 105 | 21 | ["str", "type", "numpy", "cpu", "v.detach", "self._values_order.append", "time.time", "sys.stdout.write", "sys.stdout.write", "sys.stdout.write", "float", "int", "next", "len", "sys.stdout.write", "isinstance", "max", "abs", "len", "sys.stdout.write", "sys.stdout.flush"] | 410 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.addmenu_py.AddNewContentForm.update", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.backends.memory.__init___py.MemoryBackend.pu... | The function (update) defined within the public class called ProgressBar.The function start at line 161 and ends at 265. It contains 76 lines of code and it has a cyclomatic complexity of 22. It takes 4 parameters, represented as [161.0] and does not return any value. It declares 21.0 functions, It has 21.0 functions c... |
CAREamics_careamics | ProgressBar | public | 0 | 0 | add | def add(self, n: int, values: list | None = None) -> None:"""Update the progress bar by n steps.Parameters----------n : intNumber of steps to increase the progress bar with.values : Optional[list], optionalUpdated metrics values, by default None."""self.update(self._seen_so_far + n, 1, values=values) | 1 | 2 | 3 | 36 | 0 | 267 | 278 | 267 | self,n,values | [] | None | {"Expr": 2} | 1 | 12 | 1 | ["self.update"] | 357 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.isin_converter_py.IsinConverter.add_from_transaction", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.permissions_py.invert_permis... | The function (add) defined within the public class called ProgressBar.The function start at line 267 and ends at 278. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [267.0] and does not return any value. It declare 1.0 function, It has 1.0 function called insi... |
CAREamics_careamics | ProgressBar | public | 0 | 0 | spinning_cursor | def spinning_cursor(self) -> Generator:"""Generate a spinning cursor animation.Taken from https://github.com/manrajgrover/py-spinners/tree/master.Returns-------GeneratorGenerator of animation frames."""while True:yield from ["▓ ----- ▒","▓ ----- ▒","▓ ----- ▒","▓ ->--- ▒","▓ ->--- ▒","▓ ->--- ▒","▓ -->-- ▒","▓ -->-- ▒"... | 2 | 34 | 1 | 75 | 0 | 280 | 323 | 280 | self | [] | Generator | {"Expr": 2, "While": 1} | 0 | 44 | 0 | [] | 0 | [] | The function (spinning_cursor) defined within the public class called ProgressBar.The function start at line 280 and ends at 323. It contains 34 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
CAREamics_careamics | public | public | 0 | 0 | avg_range_invariant_psnr | def avg_range_invariant_psnr(pred: np.ndarray,target: np.ndarray,) -> float:"""Compute the average range-invariant PSNR.Parameters----------pred : np.ndarrayPredicted images.target : np.ndarrayTarget images.Returns-------floatAverage range-invariant PSNR value."""psnr_arr = []for i in range(pred.shape[0]):psnr_arr.appe... | 2 | 8 | 2 | 60 | 1 | 19 | 40 | 19 | pred,target | ['psnr_arr'] | float | {"Assign": 1, "Expr": 2, "For": 1, "Return": 1} | 4 | 22 | 4 | ["range", "psnr_arr.append", "scale_invariant_psnr", "np.mean"] | 0 | [] | The function (avg_range_invariant_psnr) defined within the public class called public.The function start at line 19 and ends at 40. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [19.0] and does not return any value. It declares 4.0 functions, and It has 4.0 ... |
CAREamics_careamics | public | public | 0 | 0 | psnr | def psnr(gt: np.ndarray, pred: np.ndarray, data_range: float) -> float:"""Peak Signal to Noise Ratio.This method calls skimage.metrics.peak_signal_noise_ratio. See:https://scikit-image.org/docs/dev/api/skimage.metrics.html.NOTE: to avoid unwanted behaviors (e.g., data_range inferred from array dtype),the data_range par... | 1 | 2 | 3 | 33 | 0 | 43 | 67 | 43 | gt,pred,data_range | [] | float | {"Expr": 1, "Return": 1} | 1 | 25 | 1 | ["peak_signal_noise_ratio"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py.scale_invariant_psnr", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.utils.test_metrics_py.test_psnr"] | The function (psnr) defined within the public class called public.The function start at line 43 and ends at 67. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [43.0] and does not return any value. It declare 1.0 function, It has 1.0 function called inside whic... |
CAREamics_careamics | public | public | 0 | 0 | _zero_mean | def _zero_mean(x: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:"""Zero the mean of an array.Parameters----------x : numpy.ndarray or torch.TensorInput array.Returns-------numpy.ndarray or torch.TensorZero-mean array."""return x - x.mean() | 1 | 2 | 1 | 36 | 0 | 70 | 84 | 70 | x | [] | Union[np.ndarray, torch.Tensor] | {"Expr": 1, "Return": 1} | 1 | 15 | 1 | ["x.mean"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py._fix", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py._range_invariant_multiscale_ssim", "_.cont... | The function (_zero_mean) defined within the public class called public.The function start at line 70 and ends at 84. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside w... |
CAREamics_careamics | public | public | 0 | 0 | _fix_range | def _fix_range(gt: Union[np.ndarray, torch.Tensor], x: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:"""Adjust the range of an array based on a reference ground-truth array.Parameters----------gt : Union[np.ndarray, torch.Tensor]Ground truth array.x : Union[np.ndarray, torch.Tensor]Input array.Ret... | 1 | 5 | 2 | 66 | 1 | 87 | 106 | 87 | gt,x | ['a'] | Union[np.ndarray, torch.Tensor] | {"Assign": 1, "Expr": 1, "Return": 1} | 2 | 20 | 2 | ["sum", "sum"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py._fix"] | The function (_fix_range) defined within the public class called public.The function start at line 87 and ends at 106. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [87.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called i... |
CAREamics_careamics | public | public | 0 | 0 | _fix | def _fix(gt: Union[np.ndarray, torch.Tensor], x: Union[np.ndarray, torch.Tensor]) -> Union[np.ndarray, torch.Tensor]:"""Zero mean a groud truth array and adjust the range of the array.Parameters----------gt : Union[np.ndarray, torch.Tensor]Ground truth image.x : Union[np.ndarray, torch.Tensor]Input array.Returns-------... | 1 | 5 | 2 | 57 | 1 | 109 | 128 | 109 | gt,x | ['gt_'] | Union[np.ndarray, torch.Tensor] | {"Assign": 1, "Expr": 1, "Return": 1} | 3 | 20 | 3 | ["_zero_mean", "_fix_range", "_zero_mean"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py._range_invariant_multiscale_ssim", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py.scale_invarian... | The function (_fix) defined within the public class called public.The function start at line 109 and ends at 128. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [109.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions called insid... |
CAREamics_careamics | public | public | 0 | 0 | scale_invariant_psnr | def scale_invariant_psnr(gt: np.ndarray, pred: np.ndarray) -> Union[float, torch.tensor]:"""Scale invariant PSNR.Parameters----------gt : np.ndarrayGround truth image.pred : np.ndarrayPredicted image.Returns-------Union[float, torch.tensor]Scale invariant PSNR value."""range_parameter = (np.max(gt) - np.min(gt)) / np.s... | 1 | 6 | 2 | 79 | 2 | 131 | 151 | 131 | gt,pred | ['gt_', 'range_parameter'] | Union[float, torch.tensor] | {"Assign": 2, "Expr": 1, "Return": 1} | 8 | 21 | 8 | ["np.max", "np.min", "np.std", "_zero_mean", "np.std", "psnr", "_zero_mean", "_fix"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.eval_utils_py.get_psnr_str", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py.avg_range_invariant_psn... | The function (scale_invariant_psnr) defined within the public class called public.The function start at line 131 and ends at 151. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [131.0] and does not return any value. It declares 8.0 functions, It has 8.0 functi... |
CAREamics_careamics | RunningPSNR | public | 0 | 0 | __init__ | def __init__(self):"""Constructor."""self.N = Noneself.mse_sum = Noneself.max = self.min = Noneself.reset() | 1 | 5 | 1 | 30 | 0 | 172 | 177 | 172 | self | [] | None | {"Assign": 3, "Expr": 2} | 1 | 6 | 1 | ["self.reset"] | 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 RunningPSNR.The function start at line 172 and ends at 177. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called ins... |
CAREamics_careamics | RunningPSNR | public | 0 | 0 | reset | def reset(self):"""Reset the running PSNR computation.Usually called at the end of each epoch."""self.mse_sum = 0self.N = 0self.max = self.min = None | 1 | 4 | 1 | 25 | 0 | 179 | 186 | 179 | self | [] | None | {"Assign": 3, "Expr": 1} | 0 | 8 | 0 | [] | 21 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3547924_wavecomp_git_repo.main_py._BasicAuthHandler.http_error_auth_reqed", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3547924_wavecomp_git_repo.main_py._DigestAuthHandler.http_error_auth_reqed", "_.content.gdriv... | The function (reset) defined within the public class called RunningPSNR.The function start at line 179 and ends at 186. 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 has 21.0 functions calling this function which are ["_.... |
CAREamics_careamics | RunningPSNR | public | 0 | 0 | update | def update(self, rec: torch.Tensor, tar: torch.Tensor) -> None:"""Update the running PSNR statistics given a new batch.Parameters----------rec : torch.TensorReconstructed batch.tar : torch.TensorTarget batch."""ins_max = torch.max(tar).item()ins_min = torch.min(tar).item()if self.max is None:assert self.min is Noneself... | 2 | 14 | 3 | 155 | 0 | 188 | 211 | 188 | self,rec,tar | [] | None | {"Assign": 8, "AugAssign": 2, "Expr": 1, "If": 1} | 13 | 24 | 13 | ["item", "torch.max", "item", "torch.min", "max", "min", "torch.mean", "mse.view", "len", "torch.nansum", "len", "torch.sum", "torch.isnan"] | 409 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.addmenu_py.AddNewContentForm.update", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.backends.memory.__init___py.MemoryBackend.pu... | The function (update) defined within the public class called RunningPSNR.The function start at line 188 and ends at 211. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [188.0] and does not return any value. It declares 13.0 functions, It has 13.0 functions ca... |
CAREamics_careamics | RunningPSNR | public | 0 | 0 | get | def get(self) -> torch.Tensor | None:"""Get the actual PSNR value given the running statistics.Returns-------Optional[torch.Tensor]PSNR value."""if self.N == 0 or self.N is None:return Nonermse = torch.sqrt(self.mse_sum / self.N)return 20 * torch.log10((self.max - self.min) / rmse) | 3 | 5 | 1 | 60 | 0 | 213 | 224 | 213 | self | [] | torch.Tensor | None | {"Assign": 1, "Expr": 1, "If": 1, "Return": 2} | 2 | 12 | 2 | ["torch.sqrt", "torch.log10"] | 2,119 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.28233542_gluufederation_community_edition_containers.py... | The function (get) defined within the public class called RunningPSNR.The function start at line 213 and ends at 224. It contains 5 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called insid... |
CAREamics_careamics | public | public | 0 | 0 | _range_invariant_multiscale_ssim | def _range_invariant_multiscale_ssim(gt_: Union[np.ndarray, torch.Tensor], pred_: Union[np.ndarray, torch.Tensor]) -> float:"""Compute range invariant multiscale SSIM for a single channel.The advantage of this metric in comparison to commonly used SSIM is thatit is invariant to scalar multiplications in the prediction.... | 1 | 15 | 2 | 164 | 4 | 227 | 262 | 227 | gt_,pred_ | ['gt_', 'ms_ssim', 'shape', 'pred_'] | float | {"Assign": 9, "Expr": 1, "Return": 1} | 16 | 36 | 16 | ["torch.Tensor", "gt_.reshape", "torch.Tensor", "pred_.reshape", "_zero_mean", "_zero_mean", "_fix", "pred_.reshape", "gt_.reshape", "MultiScaleStructuralSimilarityIndexMeasure", "gt_.max", "gt_.min", "item", "ms_ssim", "torch.Tensor", "torch.Tensor"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.utils.metrics_py.multiscale_ssim"] | The function (_range_invariant_multiscale_ssim) defined within the public class called public.The function start at line 227 and ends at 262. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [227.0] and does not return any value. It declares 16.0 functions, It ... |
CAREamics_careamics | public | public | 0 | 0 | multiscale_ssim | def multiscale_ssim(gt_: Union[np.ndarray, torch.Tensor],pred_: Union[np.ndarray, torch.Tensor],range_invariant: bool = True,) -> list[Union[float, None]]:"""Compute channel-wise multiscale SSIM for each channel.It allows to use either standard multiscale SSIM or its range-invariant version.NOTE: images fed to this fun... | 4 | 21 | 3 | 174 | 4 | 265 | 307 | 265 | gt_,pred_,range_invariant | ['ms_ssim_values', 'pred_tmp', 'tar_tmp', 'ms_ssim'] | list[Union[float, None]] | {"Assign": 6, "Expr": 1, "For": 1, "If": 1, "Return": 1} | 10 | 43 | 10 | ["range", "_range_invariant_multiscale_ssim", "MultiScaleStructuralSimilarityIndexMeasure", "tar_tmp.max", "tar_tmp.min", "item", "ms_ssim", "torch.Tensor", "torch.Tensor", "range"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.utils.test_metrics_py.test_multiscale_ssim"] | The function (multiscale_ssim) defined within the public class called public.The function start at line 265 and ends at 307. It contains 21 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [265.0] and does not return any value. It declares 10.0 functions, It has 10.0 function... |
CAREamics_careamics | public | public | 0 | 0 | _avg_psnr | def _avg_psnr(target: np.ndarray, prediction: np.ndarray, psnr_fn: Callable) -> float:"""Compute the average PSNR over a batch of images.Parameters----------target : np.ndarrayArray of ground truth images, shape is (N, C, H, W).prediction : np.ndarrayArray of predicted images, shape is (N, C, H, W).psnr_fn : CallablePS... | 2 | 7 | 3 | 64 | 0 | 310 | 332 | 310 | target,prediction,psnr_fn | [] | float | {"Expr": 1, "Return": 1} | 5 | 23 | 5 | ["np.mean", "item", "psnr_fn", "range", "len"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.metrics_py.avg_psnr", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.metrics_py.avg_range_inv_psnr", "... | The function (_avg_psnr) defined within the public class called public.The function start at line 310 and ends at 332. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [310.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions called ... |
CAREamics_careamics | public | public | 0 | 0 | avg_range_inv_psnr | def avg_range_inv_psnr(target: np.ndarray, prediction: np.ndarray) -> float:"""Compute the average range-invariant PSNR over a batch of images.Parameters----------target : np.ndarrayArray of ground truth images, shape is (N, C, H, W).prediction : np.ndarrayArray of predicted images, shape is (N, C, H, W).Returns-------... | 1 | 2 | 2 | 27 | 0 | 335 | 350 | 335 | target,prediction | [] | float | {"Expr": 1, "Return": 1} | 1 | 16 | 1 | ["_avg_psnr"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lvae_training.metrics_py.compute_masked_psnr"] | The function (avg_range_inv_psnr) defined within the public class called public.The function start at line 335 and ends at 350. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [335.0] and does not return any value. It declare 1.0 function, It has 1.0 function c... |
CAREamics_careamics | public | public | 0 | 0 | avg_psnr | def avg_psnr(target: np.ndarray, prediction: np.ndarray) -> float:"""Compute the average PSNR over a batch of images.Parameters----------target : np.ndarrayArray of ground truth images, shape is (N, C, H, W).prediction : np.ndarrayArray of predicted images, shape is (N, C, H, W).Returns-------floatAverage PSNR value ov... | 1 | 2 | 2 | 27 | 0 | 353 | 368 | 353 | target,prediction | [] | float | {"Expr": 1, "Return": 1} | 1 | 16 | 1 | ["_avg_psnr"] | 0 | [] | The function (avg_psnr) defined within the public class called public.The function start at line 353 and ends at 368. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [353.0] and does not return any value. It declare 1.0 function, and It has 1.0 function called... |
CAREamics_careamics | public | public | 0 | 0 | avg_ssim | def avg_ssim(target: Union[np.ndarray, torch.Tensor], prediction: Union[np.ndarray, torch.Tensor]) -> tuple[float, float]:"""Compute the average Structural Similarity (SSIM) over a batch of images.Parameters----------target : np.ndarrayArray of ground truth images, shape is (N, C, H, W).prediction : np.ndarrayArray of ... | 2 | 10 | 2 | 99 | 1 | 371 | 394 | 371 | target,prediction | ['ssim'] | tuple[float, float] | {"Assign": 1, "Expr": 1, "Return": 1} | 7 | 24 | 7 | ["structural_similarity", "max", "min", "range", "len", "np.mean", "np.std"] | 0 | [] | The function (avg_ssim) defined within the public class called public.The function start at line 371 and ends at 394. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [371.0] and does not return any value. It declares 7.0 functions, and It has 7.0 functions ca... |
CAREamics_careamics | public | public | 0 | 0 | check_path_exists | def check_path_exists(path: Union[str, Path]) -> Path:"""Check if a path exists. If not, raise an error.Note that it returns `path` as a Path object.Parameters----------path : Union[str, Path]Path to check.Returns-------PathPath as a Path object."""path = Path(path)if not path.exists():raise FileNotFoundError(f"Data pa... | 2 | 5 | 1 | 37 | 1 | 7 | 26 | 7 | path | ['path'] | Path | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 3 | 20 | 3 | ["Path", "path.exists", "FileNotFoundError"] | 3 | ["_.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.src.careamics.careamist_py.CAREamist._train_on_path", "_.conten... | The function (check_path_exists) defined within the public class called public.The function start at line 7 and ends at 26. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called... |
CAREamics_careamics | public | public | 0 | 0 | plot_noise_model_probability_distribution | def plot_noise_model_probability_distribution(noise_model: GaussianMixtureNoiseModel,signalBinIndex: int,histogram: NDArray,channel: str | None = None,number_of_bins: int = 100,) -> None:"""Plot probability distribution P(x|s) for a certain ground truth signal.Predictions from both Histogram and GMM-basedNoise models a... | 2 | 42 | 5 | 298 | 7 | 11 | 76 | 11 | noise_model,signalBinIndex,histogram,channel,number_of_bins | ['query_signal', 'max_signal', 'query_observations', 'bin_size', 'min_signal', 'likelihoods', 'query_signal_normalized'] | None | {"Assign": 8, "AugAssign": 2, "Expr": 15, "If": 1} | 24 | 66 | 24 | ["noise_model.min_signal.item", "noise_model.max_signal.item", "torch.tensor", "torch.arange", "numpy", "noise_model.likelihood", "plt.figure", "plt.suptitle", "plt.suptitle", "plt.subplot", "plt.xlabel", "plt.ylabel", "plt.imshow", "plt.axhline", "plt.subplot", "plt.plot", "str", "np.round", "plt.xlabel", "str", "plt.... | 0 | [] | The function (plot_noise_model_probability_distribution) defined within the public class called public.The function start at line 11 and ends at 76. It contains 42 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [11.0] and does not return any value. It declares 24.0 function... |
CAREamics_careamics | public | public | 0 | 0 | get_ram_size | def get_ram_size() -> int:"""Get RAM size in mbytes.Returns-------intRAM size in mbytes."""return psutil.virtual_memory().available / 1024**2 | 1 | 2 | 0 | 19 | 0 | 6 | 15 | 6 | [] | int | {"Expr": 1, "Return": 1} | 1 | 10 | 1 | ["psutil.virtual_memory"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.train_data_module_py.TrainDataModule.setup"] | The function (get_ram_size) defined within the public class called public.The function start at line 6 and ends at 15. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside ... | |
CAREamics_careamics | public | public | 0 | 0 | _array_to_json | def _array_to_json(arr: Union[np.ndarray, torch.Tensor]) -> str:"""Convert an array to a list and then to a JSON string.Parameters----------arr : Union[np.ndarray, torch.Tensor]Array to be serialized.Returns-------strJSON string representing the array."""if isinstance(arr, str):return arrreturn json.dumps(arr.tolist()) | 2 | 4 | 1 | 40 | 0 | 11 | 26 | 11 | arr | [] | str | {"Expr": 1, "If": 1, "Return": 2} | 3 | 16 | 3 | ["isinstance", "json.dumps", "arr.tolist"] | 0 | [] | The function (_array_to_json) defined within the public class called public.The function start at line 11 and ends at 26. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions cal... |
CAREamics_careamics | public | public | 0 | 0 | _to_numpy | def _to_numpy(lst: Union[str, list]) -> np.ndarray:"""Deserialize a list or string representing a list into `np.ndarray`.Parameters----------lst : listList or string representing a list with the array content to be deserialized.Returns-------np.ndarrayThe deserialized array."""if isinstance(lst, str):lst = ast.literal_... | 2 | 4 | 1 | 40 | 1 | 29 | 44 | 29 | lst | ['lst'] | np.ndarray | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 3 | 16 | 3 | ["isinstance", "ast.literal_eval", "np.asarray"] | 0 | [] | The function (_to_numpy) defined within the public class called public.The function start at line 29 and ends at 44. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions called i... |
CAREamics_careamics | public | public | 0 | 0 | _to_torch | def _to_torch(lst: Union[str, list]) -> torch.Tensor:"""Deserialize list or string representing a list into `torch.Tensor`.Parameters----------lst : Union[str, list]List or string representing a list swith the array content to be deserialized.Returns-------torch.TensorThe deserialized tensor."""if isinstance(lst, str):... | 2 | 4 | 1 | 40 | 1 | 47 | 62 | 47 | lst | ['lst'] | torch.Tensor | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 3 | 16 | 3 | ["isinstance", "ast.literal_eval", "torch.tensor"] | 0 | [] | The function (_to_torch) defined within the public class called public.The function start at line 47 and ends at 62. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions called i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.