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
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_get_hashed_file_name_from_root_str
def _get_hashed_file_name_from_root_str(manifest: BaseAssetManifest,source_root: str,manifest_name_suffix: str,) -> tuple[HashAlgorithm, str]:"""Gathers metadata information of manifest to be used for writing the local manifest"""hash_alg = manifest.get_default_hash_alg()manifest_name_prefix = hash_data(source_root.enc...
1
9
3
53
0
335
347
335
manifest,source_root,manifest_name_suffix
[]
tuple[HashAlgorithm, str]
{"Assign": 3, "Expr": 1, "Return": 1}
3
13
3
["manifest.get_default_hash_alg", "hash_data", "source_root.encode"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.asset_sync_py.AssetSync._check_and_write_local_manifests", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.un...
The function (_get_hashed_file_name_from_root_str) defined within the public class called S3AssetUploader.The function start at line 335 and ends at 347. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [335.0] and does not return any value. It declares 3.0 func...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_write_local_input_manifest
def _write_local_input_manifest(manifest_write_dir: str,manifest_name: str,manifest: BaseAssetManifest,root_dir_name: Optional[str] = None,) -> Path:"""Creates 'manifests' sub-directory and writes a local input manifest file"""input_manifest_folder_name = "manifests"if root_dir_name is not None:input_manifest_folder_na...
2
15
4
97
0
350
369
350
manifest_write_dir,manifest_name,manifest,root_dir_name
[]
Path
{"Assign": 3, "Expr": 4, "If": 1, "Return": 1, "With": 1}
6
20
6
["Path", "logger.debug", "local_manifest_file.parent.mkdir", "open", "file.write", "manifest.encode"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.asset_sync_py.AssetSync._check_and_write_local_manifests"]
The function (_write_local_input_manifest) defined within the public class called S3AssetUploader.The function start at line 350 and ends at 369. It contains 15 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [350.0] and does not return any value. It declares 6.0 functions, ...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_write_local_manifest_s3_mapping
def _write_local_manifest_s3_mapping(self,manifest_write_dir: str,manifest_name: str,full_manifest_key: str,manifest_dir_name: Optional[str] = None,):"""Create or append to an existing mapping file. We use this since path lengths can go beyond thefile name length limit on Windows if we were to create the full S3 key pa...
2
13
5
68
0
371
387
371
self,manifest_write_dir,manifest_name,full_manifest_key,manifest_dir_name
[]
None
{"Assign": 2, "Expr": 2, "With": 1}
3
17
3
["Path", "open", "mapping_file.write"]
0
[]
The function (_write_local_manifest_s3_mapping) defined within the public class called S3AssetUploader.The function start at line 371 and ends at 387. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [371.0] and does not return any value. It declares 3.0 functi...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
upload_input_files
def upload_input_files(self,manifest: BaseAssetManifest,s3_bucket: str,source_root: Path,s3_cas_prefix: str,progress_tracker: Optional[ProgressTracker] = None,s3_check_cache_dir: Optional[str] = None,) -> None:"""Uploads all of the files listed in the given manifest to S3 if they don't exist in thegiven S3 prefix alrea...
10
51
7
228
0
389
459
389
self,manifest,s3_bucket,source_root,s3_cas_prefix,progress_tracker,s3_check_cache_dir
[]
None
{"Assign": 4, "Expr": 4, "For": 2, "If": 4, "With": 2}
12
71
12
["self._separate_files_by_size", "S3CheckCache", "concurrent.futures.ThreadPoolExecutor", "executor.submit", "concurrent.futures.as_completed", "future.result", "progress_tracker.increase_skipped", "self.upload_object_to_cas", "progress_tracker.increase_skipped", "progress_tracker.report_progress", "AssetSyncCancelledE...
0
[]
The function (upload_input_files) defined within the public class called S3AssetUploader.The function start at line 389 and ends at 459. It contains 51 lines of code and it has a cyclomatic complexity of 10. It takes 7 parameters, represented as [389.0] and does not return any value. It declares 12.0 functions, and It...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_snapshot_input_files
def _snapshot_input_files(self,snapshot_dir: Path,manifest: BaseAssetManifest,source_root: Path,progress_tracker: Optional[ProgressTracker] = None,) -> None:"""Snapshots all of the files listed in the given manifest to snapshot_dir."""os.makedirs(snapshot_dir / S3_DATA_FOLDER_NAME, exist_ok=True)# Process all the paths...
5
28
5
133
0
461
497
461
self,snapshot_dir,manifest,source_root,progress_tracker
[]
None
{"Assign": 1, "Expr": 4, "For": 1, "If": 2, "With": 1}
8
37
8
["os.makedirs", "concurrent.futures.ThreadPoolExecutor", "executor.submit", "concurrent.futures.as_completed", "future.result", "progress_tracker.report_progress", "AssetSyncCancelledError", "progress_tracker.get_summary_statistics"]
0
[]
The function (_snapshot_input_files) defined within the public class called S3AssetUploader.The function start at line 461 and ends at 497. It contains 28 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [461.0] and does not return any value. It declares 8.0 functions, and I...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
reset_s3_check_cache
def reset_s3_check_cache(self, s3_check_cache_dir: Optional[str]) -> None:"""Resets the S3 check cache by removing the cache altogether."""with S3CheckCache(s3_check_cache_dir) as s3_check_cache:logger.debug(f"The s3_check_cache.db file in {s3_check_cache_dir} will be deleted, "f"as a mismatch between the cache and the...
1
7
2
37
0
499
509
499
self,s3_check_cache_dir
[]
None
{"Expr": 3, "With": 1}
3
11
3
["S3CheckCache", "logger.debug", "s3_check_cache.remove_cache"]
0
[]
The function (reset_s3_check_cache) defined within the public class called S3AssetUploader.The function start at line 499 and ends at 509. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [499.0] and does not return any value. It declares 3.0 functions, and It ...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_check_hashes_exist_in_s3
def _check_hashes_exist_in_s3(self, cache_entries: List[S3CheckCacheEntry]) -> bool:"""checks if the hashes in the cache entries exist in S3"""for cache_entry in cache_entries:try:# Split the S3 key into bucket and key partsbucket, key = cache_entry.s3_key.split("/", 1)# Check if the object is already uploaded and exis...
4
12
2
77
0
511
533
511
self,cache_entries
[]
bool
{"Assign": 1, "Expr": 3, "For": 1, "If": 1, "Return": 3, "Try": 1}
4
23
4
["cache_entry.s3_key.split", "self.file_already_uploaded", "logger.debug", "logger.warning"]
0
[]
The function (_check_hashes_exist_in_s3) defined within the public class called S3AssetUploader.The function start at line 511 and ends at 533. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [511.0] and does not return any value. It declares 4.0 functions, an...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
verify_hash_cache_integrity
def verify_hash_cache_integrity(self,s3_check_cache_dir: Optional[str],manifest: BaseAssetManifest,s3_cas_prefix: str,s3_bucket: str,) -> bool:"""Inspects a sampling of the assets provided in manifest that are present in the S3 check cache andverifies if the cached assets exist in S3. Returns True if all sampled cached...
5
24
5
133
0
535
565
535
self,s3_check_cache_dir,manifest,s3_cas_prefix,s3_bucket
[]
bool
{"AnnAssign": 2, "Assign": 2, "Expr": 3, "For": 1, "If": 2, "Return": 1, "With": 1}
8
31
8
["self._generate_s3_upload_key", "random.shuffle", "S3CheckCache", "s3_cache.get_local_connection", "s3_cache.get_connection_entry", "sampled_cache_entries.append", "len", "self._check_hashes_exist_in_s3"]
0
[]
The function (verify_hash_cache_integrity) defined within the public class called S3AssetUploader.The function start at line 535 and ends at 565. It contains 24 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [535.0] and does not return any value. It declares 8.0 functions, ...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_separate_files_by_size
def _separate_files_by_size(self,files_to_upload: list[base_manifest.BaseManifestPath],size_threshold: int,) -> Tuple[list[base_manifest.BaseManifestPath], list[base_manifest.BaseManifestPath]]:"""Splits the given list of files into two queues: one for small files and one for large files."""small_file_queue: list[base_...
3
13
3
91
0
567
582
567
self,files_to_upload,size_threshold
[]
Tuple[list[base_manifest.BaseManifestPath], list[base_manifest.BaseManifestPath]]
{"AnnAssign": 2, "Expr": 3, "For": 1, "If": 1, "Return": 1}
2
16
2
["small_file_queue.append", "large_file_queue.append"]
0
[]
The function (_separate_files_by_size) defined within the public class called S3AssetUploader.The function start at line 567 and ends at 582. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [567.0] and does not return any value. It declares 2.0 functions, and ...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_get_current_timestamp
def _get_current_timestamp(self) -> str:return str(datetime.now().timestamp())
1
2
1
20
0
584
585
584
self
[]
str
{"Return": 1}
3
2
3
["str", "timestamp", "datetime.now"]
0
[]
The function (_get_current_timestamp) defined within the public class called S3AssetUploader.The function start at line 584 and ends at 585. 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 3.0 functions, and It ha...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_generate_s3_upload_key
def _generate_s3_upload_key(self,file: base_manifest.BaseManifestPath,hash_algorithm: HashAlgorithm,s3_cas_prefix: str,) -> str:s3_upload_key = f"{file.hash}.{hash_algorithm.value}"if s3_cas_prefix:s3_upload_key = _join_s3_paths(s3_cas_prefix, s3_upload_key)return s3_upload_key
2
10
4
39
0
587
596
587
self,file,hash_algorithm,s3_cas_prefix
[]
str
{"Assign": 2, "If": 1, "Return": 1}
1
10
1
["_join_s3_paths"]
0
[]
The function (_generate_s3_upload_key) defined within the public class called S3AssetUploader.The function start at line 587 and ends at 596. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [587.0] and does not return any value. It declare 1.0 function, and I...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
upload_object_to_cas
def upload_object_to_cas(self,file: base_manifest.BaseManifestPath,hash_algorithm: HashAlgorithm,s3_bucket: str,source_root: Path,s3_cas_prefix: str,s3_check_cache: S3CheckCache,progress_tracker: Optional[ProgressTracker] = None,) -> Tuple[bool, int]:"""Uploads an object to the S3 content-addressable storage (CAS) pref...
3
39
8
180
0
598
645
598
self,file,hash_algorithm,s3_bucket,source_root,s3_cas_prefix,s3_check_cache,progress_tracker
[]
Tuple[bool, int]
{"Assign": 4, "Expr": 5, "If": 2, "Return": 2}
11
48
11
["source_root.joinpath", "self._generate_s3_upload_key", "s3_check_cache.get_connection_entry", "s3_check_cache.get_local_connection", "logger.debug", "self.file_already_uploaded", "logger.debug", "self.upload_file_to_s3", "s3_check_cache.put_entry", "S3CheckCacheEntry", "self._get_current_timestamp"]
0
[]
The function (upload_object_to_cas) defined within the public class called S3AssetUploader.The function start at line 598 and ends at 645. It contains 39 lines of code and it has a cyclomatic complexity of 3. It takes 8 parameters, represented as [598.0] and does not return any value. It declares 11.0 functions, and I...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_snapshot_object_to_cas
def _snapshot_object_to_cas(self,file: base_manifest.BaseManifestPath,hash_algorithm: HashAlgorithm,snapshot_dir: Path,source_root: Path,progress_tracker: Optional[ProgressTracker] = None,):"""Snapshots an object to the snapshot directory content-addressable storage (CAS) prefix."""local_path = source_root.joinpath(fil...
2
14
6
91
0
647
664
647
self,file,hash_algorithm,snapshot_dir,source_root,progress_tracker
[]
None
{"Assign": 3, "Expr": 3, "If": 1}
6
18
6
["source_root.joinpath", "self._generate_s3_upload_key", "stat", "local_path.resolve", "shutil.copy2", "progress_tracker.track_progress_callback"]
0
[]
The function (_snapshot_object_to_cas) defined within the public class called S3AssetUploader.The function start at line 647 and ends at 664. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [647.0] and does not return any value. It declares 6.0 functions, and ...
aws-deadline_deadline-cloud
public
public
0
0
upload_file_to_s3.handler
def handler(bytes_uploaded):nonlocal progress_trackernonlocal futureif progress_tracker:should_continue = progress_tracker.track_progress_callback(bytes_uploaded)if not should_continue and future is not None:future.cancel()
4
7
1
34
0
684
691
684
null
[]
None
null
0
0
0
null
0
null
The function (upload_file_to_s3.handler) defined within the public class called public.The function start at line 684 and ends at 691. It contains 7 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
upload_file_to_s3
def upload_file_to_s3(self,local_path: Path,s3_bucket: str,s3_upload_key: str,progress_tracker: Optional[ProgressTracker] = None,base_dir_path: Optional[Path] = None,) -> None:"""Uploads a single file to an S3 bucket using TransferManager, allowing mid-waycancellation. It monitors for upload progress through a callback...
15
72
6
328
0
666
761
666
self,local_path,s3_bucket,s3_upload_key,progress_tracker,base_dir_path
[]
None
{"AnnAssign": 1, "Assign": 10, "Expr": 4, "If": 7, "Return": 2, "Try": 1, "With": 1}
25
96
25
["get_s3_transfer_manager", "progress_tracker.track_progress_callback", "future.cancel", "ProgressCallbackInvoker", "local_path.resolve", "self._is_file_within_directory", "real_path.is_dir", "real_path.exists", "self._open_non_symlink_file_binary", "str", "transfer_manager.upload", "future.result", "progress_tracker.i...
0
[]
The function (upload_file_to_s3) defined within the public class called S3AssetUploader.The function start at line 666 and ends at 761. It contains 72 lines of code and it has a cyclomatic complexity of 15. It takes 6 parameters, represented as [666.0] and does not return any value. It declares 25.0 functions, and It ...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_open_non_symlink_file_binary
def _open_non_symlink_file_binary(self, path: str) -> Generator[Optional[BufferedReader], None, None]:"""Open a file in binary mode after verifying that it is not a symbolic link.Raises:OSError: If the given path is a symbolic link or doesn't match the actual file."""fd = Nonefile_obj = Nonetry:open_flags = os.O_RDONLY...
11
32
2
199
0
764
811
764
self,path
[]
Generator[Optional[BufferedReader], None, None]
{"Assign": 4, "AugAssign": 1, "Expr": 8, "If": 7, "Try": 1, "With": 1}
14
48
14
["hasattr", "os.path.islink", "logger.warning", "os.open", "self._is_path_win32_final_path_of_file_descriptor", "OSError", "str", "resolve", "Path", "OSError", "os.fdopen", "logger.warning", "os.close", "file_obj.close"]
0
[]
The function (_open_non_symlink_file_binary) defined within the public class called S3AssetUploader.The function start at line 764 and ends at 811. It contains 32 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [764.0] and does not return any value. It declares 14.0 functio...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_is_path_win32_final_path_of_file_descriptor
def _is_path_win32_final_path_of_file_descriptor(self, path: str, fd: int):"""Check if the normalized path from the file descriptor matches the specified path."""if sys.platform != "win32":raise EnvironmentError("This function can only be executed on Windows systems.")import ctypesimport msvcrtfrom ._windows import fil...
10
46
3
224
0
813
881
813
self,path,fd
[]
Returns
{"Assign": 13, "Expr": 4, "If": 6, "Return": 3, "Try": 1}
15
69
15
["EnvironmentError", "msvcrt.get_osfhandle", "logger.warning", "ctypes.create_unicode_buffer", "win_file.GetFinalPathNameByHandleW", "ctypes.WinError", "ctypes.create_unicode_buffer", "win_file.GetFinalPathNameByHandleW", "logger.error", "ctypes.wstring_at", "final_path.startswith", "path.startswith", "final_path.start...
0
[]
The function (_is_path_win32_final_path_of_file_descriptor) defined within the public class called S3AssetUploader.The function start at line 813 and ends at 881. It contains 46 lines of code and it has a cyclomatic complexity of 10. It takes 3 parameters, represented as [813.0], and this function return a value. It de...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
_is_file_within_directory
def _is_file_within_directory(self, file_path: Path, directory_path: Path) -> bool:"""Checks if the given file path is within the given directory path."""real_file_path = file_path.resolve()real_directory_path = directory_path.resolve()common_path = os.path.commonpath([real_file_path, real_directory_path])return common...
1
5
3
54
0
883
890
883
self,file_path,directory_path
[]
bool
{"Assign": 3, "Expr": 1, "Return": 1}
5
8
5
["file_path.resolve", "directory_path.resolve", "os.path.commonpath", "common_path.startswith", "str"]
0
[]
The function (_is_file_within_directory) defined within the public class called S3AssetUploader.The function start at line 883 and ends at 890. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [883.0] and does not return any value. It declares 5.0 functions, and...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
file_already_uploaded
def file_already_uploaded(self, bucket: str, key: str) -> bool:"""Check whether the file has already been uploaded by doing a head-object call."""try:self._s3.head_object(Bucket=bucket,Key=key,)return Trueexcept ClientError as exc:error_code = int(exc.response["ResponseMetadata"]["HTTPStatusCode"])if error_code == 403:...
5
25
3
117
0
892
919
892
self,bucket,key
[]
bool
{"Assign": 2, "Expr": 2, "If": 1, "Return": 2, "Try": 1}
7
28
7
["self._s3.head_object", "int", "get_account_id", "JobAttachmentsS3ClientError", "JobAttachmentS3BotoCoreError", "str", "AssetSyncError"]
0
[]
The function (file_already_uploaded) defined within the public class called S3AssetUploader.The function start at line 892 and ends at 919. It contains 25 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [892.0] and does not return any value. It declares 7.0 functions, and I...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
upload_bytes_to_s3
def upload_bytes_to_s3(self,bytes: BytesIO,bucket: str,key: str,progress_handler: Optional[Callable[[int], None]] = None,extra_args: dict[str, Any] = dict(),) -> None:try:extra_args_merged: dict[str, Union[str, dict]] = {"ExpectedBucketOwner": get_account_id(session=self._session),**extra_args,}self._s3.upload_fileobj(...
5
52
7
216
0
921
973
921
self,bytes,bucket,key,progress_handler,extra_args
[]
None
{"AnnAssign": 1, "Assign": 2, "Expr": 1, "Try": 1}
11
53
11
["dict", "get_account_id", "self._s3.upload_fileobj", "int", "str", "JobAttachmentsS3ClientError", "status_code_guidance.get", "str", "JobAttachmentS3BotoCoreError", "str", "AssetSyncError"]
0
[]
The function (upload_bytes_to_s3) defined within the public class called S3AssetUploader.The function start at line 921 and ends at 973. It contains 52 lines of code and it has a cyclomatic complexity of 5. It takes 7 parameters, represented as [921.0] and does not return any value. It declares 11.0 functions, and It ...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
__init__
def __init__(self,farm_id: Optional[str] = None,queue_id: Optional[str] = None,job_attachment_settings: Optional[JobAttachmentS3Settings] = None,asset_uploader: Optional[S3AssetUploader] = None,session: Optional[boto3.Session] = None,asset_manifest_version: ManifestVersion = ManifestVersion.v2023_03_03,) -> None:self.f...
5
26
7
144
0
981
1,010
981
self,session
[]
None
{"Assign": 11, "If": 5, "Try": 1}
10
46
10
["get_boto3_session", "int", "config_file.get_setting", "int", "config_file.get_setting", "int", "min", "AssetSyncError", "get_s3_client", "AssetSyncError"]
4,993
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.logging_py.LoggerHandler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.schedule_...
The function (__init__) defined within the public class called S3AssetUploader.The function start at line 981 and ends at 1010. It contains 26 lines of code and it has a cyclomatic complexity of 5. It takes 7 parameters, represented as [981.0] and does not return any value. It declares 10.0 functions, It has 10.0 funct...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_process_input_path
def _process_input_path(self,path: Path,root_path: str,hash_cache: HashCache,progress_tracker: Optional[ProgressTracker] = None,update: bool = True,) -> Tuple[FileStatus, int, base_manifest.BaseManifestPath]:# If it's cancelled, raise an AssetSyncCancelledError exceptionif progress_tracker and not progress_tracker.cont...
7
46
6
312
0
1,012
1,068
1,012
self,path,root_path,hash_cache,progress_tracker,update
[]
Tuple[FileStatus, int, base_manifest.BaseManifestPath]
{"AnnAssign": 5, "Assign": 11, "Expr": 1, "If": 4, "Return": 1}
22
57
22
["AssetSyncCancelledError", "progress_tracker.get_summary_statistics", "ManifestModelRegistry.get_manifest_model", "manifest_model.AssetManifest.get_default_hash_alg", "str", "path.resolve", "str", "datetime.fromtimestamp", "path.stat", "hash_cache.get_connection_entry", "hash_cache.get_local_connection", "hash_file", ...
0
[]
The function (_process_input_path) defined within the public class called S3AssetManager.The function start at line 1012 and ends at 1068. It contains 46 lines of code and it has a cyclomatic complexity of 7. It takes 6 parameters, represented as [1012.0] and does not return any value. It declares 22.0 functions, and ...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_create_manifest_file
def _create_manifest_file(self,input_paths: list[Path],root_path: str,hash_cache: HashCache,progress_tracker: Optional[ProgressTracker] = None,) -> BaseAssetManifest:manifest_model: Type[BaseManifestModel] = ManifestModelRegistry.get_manifest_model(version=self.manifest_version)if manifest_model.manifest_version in {Ma...
8
41
5
254
0
1,070
1,116
1,070
self,input_paths,root_path,hash_cache,progress_tracker
[]
BaseAssetManifest
{"AnnAssign": 3, "Assign": 3, "Expr": 5, "For": 1, "If": 3, "Return": 1, "With": 1}
14
47
14
["ManifestModelRegistry.get_manifest_model", "concurrent.futures.ThreadPoolExecutor", "executor.submit", "concurrent.futures.as_completed", "future.result", "paths.append", "progress_tracker.increase_processed", "progress_tracker.increase_skipped", "progress_tracker.report_progress", "paths.sort", "manifest_model.Asset...
0
[]
The function (_create_manifest_file) defined within the public class called S3AssetManager.The function start at line 1070 and ends at 1116. It contains 41 lines of code and it has a cyclomatic complexity of 8. It takes 5 parameters, represented as [1070.0] and does not return any value. It declares 14.0 functions, and...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_get_asset_groups
def _get_asset_groups(self,input_paths: set[str],output_paths: set[str],referenced_paths: set[str],local_type_locations: dict[str, str] = {},shared_type_locations: dict[str, str] = {},require_paths_exist: bool = False,) -> list[AssetRootGroup]:"""For the given input paths and output paths, a list of groups is returned,...
21
86
7
539
0
1,118
1,242
1,118
self,input_paths,output_paths,referenced_paths,local_type_locations,shared_type_locations,require_paths_exist
[]
list[AssetRootGroup]
{"AnnAssign": 4, "Assign": 17, "AugAssign": 2, "Expr": 8, "For": 4, "If": 10, "Return": 1}
50
125
50
["set", "set", "Path", "os.path.normpath", "absolute", "Path", "abs_path.exists", "missing_input_paths.add", "logger.warning", "referenced_paths.add", "abs_path.is_dir", "misconfigured_directories.add", "any", "_is_relative_to", "self._find_matched_root_from_local_type_locations", "self._get_matched_group", "matched_gr...
0
[]
The function (_get_asset_groups) defined within the public class called S3AssetManager.The function start at line 1118 and ends at 1242. It contains 86 lines of code and it has a cyclomatic complexity of 21. It takes 7 parameters, represented as [1118.0] and does not return any value. It declares 50.0 functions, and I...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_get_matched_group
def _get_matched_group(self, root_path: str, groupings: dict[str, AssetRootGroup]) -> AssetRootGroup:root_normcase = os.path.normcase(root_path)matched_group = next((group for key, group in groupings.items() if os.path.normcase(key) == root_normcase),None,)if matched_group is None:raise ValueError(f"No group found for ...
4
13
3
75
0
1,244
1,256
1,244
self,root_path,groupings
[]
AssetRootGroup
{"Assign": 2, "If": 1, "Return": 1}
5
13
5
["os.path.normcase", "next", "groupings.items", "os.path.normcase", "ValueError"]
0
[]
The function (_get_matched_group) defined within the public class called S3AssetManager.The function start at line 1244 and ends at 1256. It contains 13 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [1244.0] and does not return any value. It declares 5.0 functions, and It...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_find_matched_root_from_local_type_locations
def _find_matched_root_from_local_type_locations(self,groupings: dict[str, AssetRootGroup],abs_path: Path,local_type_locations: dict[str, str] = {},) -> str:"""Checks if the given `abs_path` is relative to any of the File System Locations of LOCAL type.If it is, select the most specific File System Location, and add a ...
9
27
4
165
0
1,258
1,291
1,258
self,groupings,abs_path,local_type_locations
[]
str
{"Assign": 7, "Expr": 1, "For": 1, "If": 4, "Return": 3}
10
34
10
["local_type_locations.keys", "_is_relative_to", "len", "len", "AssetRootGroup", "os.path.normcase", "groupings.keys", "PurePath", "os.path.normcase", "AssetRootGroup"]
0
[]
The function (_find_matched_root_from_local_type_locations) defined within the public class called S3AssetManager.The function start at line 1258 and ends at 1291. It contains 27 lines of code and it has a cyclomatic complexity of 9. It takes 4 parameters, represented as [1258.0] and does not return any value. It decla...
aws-deadline_deadline-cloud
public
public
0
0
_get_total_size_of_files.get_file_size
def get_file_size(path_str: str) -> int:try:return Path(path_str).resolve().stat().st_sizeexcept (FileNotFoundError, PermissionError, OSError):logger.warning(f"Skipping file in size calculation: {path_str}")return 0
2
6
1
44
0
1,294
1,299
1,294
null
[]
None
null
0
0
0
null
0
null
The function (_get_total_size_of_files.get_file_size) defined within the public class called public.The function start at line 1294 and ends at 1299. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_get_total_size_of_files
def _get_total_size_of_files(self, paths: list[str]) -> int:def get_file_size(path_str: str) -> int:try:return Path(path_str).resolve().stat().st_sizeexcept (FileNotFoundError, PermissionError, OSError):logger.warning(f"Skipping file in size calculation: {path_str}")return 0with concurrent.futures.ThreadPoolExecutor(ma...
1
5
2
48
0
1,293
1,304
1,293
self,paths
[]
int
{"Assign": 1, "Expr": 1, "Return": 3, "Try": 1, "With": 1}
8
12
8
["stat", "resolve", "Path", "logger.warning", "concurrent.futures.ThreadPoolExecutor", "list", "executor.map", "sum"]
0
[]
The function (_get_total_size_of_files) defined within the public class called S3AssetManager.The function start at line 1293 and ends at 1304. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1293.0] and does not return any value. It declares 8.0 functions, an...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_get_total_input_size_from_manifests
def _get_total_input_size_from_manifests(self, manifests: list[AssetRootManifest]) -> tuple[int, int]:total_files = 0total_bytes = 0for asset_root_manifest in manifests:if asset_root_manifest.asset_manifest:total_files += len(asset_root_manifest.asset_manifest.paths)for path in asset_root_manifest.asset_manifest.paths:...
4
11
2
65
0
1,306
1,316
1,306
self,manifests
[]
tuple[int, int]
{"Assign": 2, "AugAssign": 2, "For": 2, "If": 1, "Return": 1}
1
11
1
["len"]
0
[]
The function (_get_total_input_size_from_manifests) defined within the public class called S3AssetManager.The function start at line 1306 and ends at 1316. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [1306.0] and does not return any value. It declare 1.0 f...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_get_total_input_size_from_asset_group
def _get_total_input_size_from_asset_group(self, groups: list[AssetRootGroup]) -> tuple[int, int]:total_files = 0total_bytes = 0for group in groups:input_paths = [str(input) for input in group.inputs]total_bytes += self._get_total_size_of_files(input_paths)total_files += len(input_paths)return (total_files, total_bytes...
3
10
2
64
0
1,318
1,327
1,318
self,groups
[]
tuple[int, int]
{"Assign": 3, "AugAssign": 2, "For": 1, "Return": 1}
3
10
3
["str", "self._get_total_size_of_files", "len"]
0
[]
The function (_get_total_input_size_from_asset_group) defined within the public class called S3AssetManager.The function start at line 1318 and ends at 1327. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1318.0] and does not return any value. It declares 3....
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_get_file_system_locations_by_type
def _get_file_system_locations_by_type(self,storage_profile_for_queue: StorageProfile,) -> Tuple[dict, dict]:"""Given the Storage Profile for Queue object, extracts and groupspath and name pairs from the File System Locations into two dicts,LOCAL and SHARED type, respectively. Returns a tuple of two dicts."""local_type...
4
12
2
89
0
1,329
1,345
1,329
self,storage_profile_for_queue
[]
Tuple[dict, dict]
{"AnnAssign": 2, "Assign": 2, "Expr": 1, "For": 1, "If": 2, "Return": 1}
0
17
0
[]
0
[]
The function (_get_file_system_locations_by_type) defined within the public class called S3AssetManager.The function start at line 1329 and ends at 1345. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [1329.0] and does not return any value..
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
_group_asset_paths
def _group_asset_paths(self,input_paths: list[str],output_paths: list[str],referenced_paths: list[str],storage_profile: Optional[StorageProfile],require_paths_exist: bool,) -> list[AssetRootGroup]:"""Resolves all of the paths that will be uploaded, sorting by storage profile location."""local_type_locations: dict[str, ...
8
24
6
132
0
1,347
1,376
1,347
self,input_paths,output_paths,referenced_paths,storage_profile,require_paths_exist
[]
list[AssetRootGroup]
{"AnnAssign": 3, "Assign": 1, "Expr": 1, "If": 1, "Return": 1}
2
30
2
["self._get_file_system_locations_by_type", "self._get_asset_groups"]
0
[]
The function (_group_asset_paths) defined within the public class called S3AssetManager.The function start at line 1347 and ends at 1376. It contains 24 lines of code and it has a cyclomatic complexity of 8. It takes 6 parameters, represented as [1347.0] and does not return any value. It declares 2.0 functions, and It...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
prepare_paths_for_upload
def prepare_paths_for_upload(self,input_paths: list[str],output_paths: list[str],referenced_paths: list[str],storage_profile: Optional[StorageProfile] = None,require_paths_exist: bool = False,) -> AssetUploadGroup:"""Processes all of the paths required for upload, grouping them by asset root and local storage profile l...
1
21
6
90
0
1,378
1,403
1,378
self,input_paths,output_paths,referenced_paths,storage_profile,require_paths_exist
[]
AssetUploadGroup
{"Assign": 2, "Expr": 1, "Return": 1}
3
26
3
["self._group_asset_paths", "self._get_total_input_size_from_asset_group", "AssetUploadGroup"]
0
[]
The function (prepare_paths_for_upload) defined within the public class called S3AssetManager.The function start at line 1378 and ends at 1403. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [1378.0] and does not return any value. It declares 3.0 functions, a...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
hash_assets_and_create_manifest
def hash_assets_and_create_manifest(self,asset_groups: list[AssetRootGroup],total_input_files: int,total_input_bytes: int,hash_cache_dir: Optional[str] = None,on_preparing_to_submit: Optional[Callable[[Any], bool]] = None,) -> tuple[SummaryStatistics, list[AssetRootManifest]]:"""Computes the hashes for input files, and...
3
33
7
203
0
1,405
1,459
1,405
self,asset_groups,total_input_files,total_input_bytes,hash_cache_dir,on_preparing_to_submit
[]
tuple[SummaryStatistics, list[AssetRootManifest]]
{"AnnAssign": 2, "Assign": 4, "Expr": 2, "For": 1, "If": 1, "Return": 1, "With": 1}
12
55
12
["time.perf_counter", "ProgressTracker", "HashCache", "self._create_manifest_file", "sorted", "list", "asset_root_manifests.append", "AssetRootManifest", "sorted", "list", "time.perf_counter", "progress_tracker.get_summary_statistics"]
0
[]
The function (hash_assets_and_create_manifest) defined within the public class called S3AssetManager.The function start at line 1405 and ends at 1459. It contains 33 lines of code and it has a cyclomatic complexity of 3. It takes 7 parameters, represented as [1405.0] and does not return any value. It declares 12.0 func...
aws-deadline_deadline-cloud
S3AssetUploader
public
0
0
upload_assets
def upload_assets(self,manifests: list[AssetRootManifest],on_uploading_assets: Optional[Callable[[Any], bool]] = None,s3_check_cache_dir: Optional[str] = None,manifest_write_dir: Optional[str] = None,) -> tuple[SummaryStatistics, Attachments]:"""Uploads all the files for provided manifests and manifests themselves to S...
7
63
6
336
0
1,461
1,547
1,461
self,job_attachment_settings,manifest,source_root,partial_manifest_prefix,file_system_location_name,progress_tracker,s3_check_cache_dir,manifest_write_dir,manifest_name_suffix,manifest_metadata,manifest_file_name,asset_root
[]
tuple[str, str]
{"Assign": 5, "Expr": 5, "If": 4, "Return": 1}
13
89
13
["dict", "S3AssetUploader._gather_upload_metadata", "_join_s3_paths", "job_attachment_settings.add_root_and_manifest_folder_prefix", "self._write_local_manifest", "self.upload_bytes_to_s3", "BytesIO", "self.verify_hash_cache_integrity", "job_attachment_settings.full_cas_prefix", "self.reset_s3_check_cache", "self.uploa...
0
[]
The function (upload_assets) defined within the public class called S3AssetUploader.The function start at line 1461 and ends at 1547. It contains 63 lines of code and it has a cyclomatic complexity of 7. It takes 6 parameters, represented as [1461.0] and does not return any value. It declares 13.0 functions, and It ha...
aws-deadline_deadline-cloud
S3AssetManager
public
0
0
snapshot_assets
def snapshot_assets(self,snapshot_dir: str,manifests: list[AssetRootManifest],on_snapshotting_assets: Optional[Callable[[Any], bool]] = None,) -> tuple[SummaryStatistics, Attachments]:"""Copies all the files for provided manifests and manifests themselves into a snapshot directorythat matches the layout of a job attach...
6
48
5
284
0
1,549
1,622
1,549
self,snapshot_dir,manifests,on_snapshotting_assets
[]
tuple[SummaryStatistics, Attachments]
{"AnnAssign": 2, "Assign": 8, "Expr": 3, "For": 1, "If": 2, "Return": 1}
17
74
17
["logger.error", "JobAttachmentsError", "self._get_total_input_size_from_manifests", "ProgressTracker", "time.perf_counter", "str", "path.relative_to", "ManifestProperties", "PathFormat.get_host_path_format", "self.asset_uploader._snapshot_assets", "Path", "self.job_attachment_settings.partial_manifest_prefix", "Path",...
0
[]
The function (snapshot_assets) defined within the public class called S3AssetManager.The function start at line 1549 and ends at 1622. It contains 48 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [1549.0] and does not return any value. It declares 17.0 functions, and It h...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
__init__
def __init__(self,asset_bucket: str,region: str,manifest_path: str,mount_point: str,os_user: str,os_env_vars: Dict[str, str],os_group: Optional[str] = None,cas_prefix: Optional[str] = None,asset_cache_path: Optional[str] = None,):self._mount_point = mount_pointself._vfs_proc = Noneself._vfs_thread = Noneself._mount_tem...
1
25
10
127
0
64
88
64
self,asset_bucket,region,manifest_path,mount_point,os_user,os_env_vars,os_group,cas_prefix,asset_cache_path
[]
None
{"Assign": 13}
0
25
0
[]
4,993
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.logging_py.LoggerHandler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.schedule_...
The function (__init__) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 64 and ends at 88. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 10 parameters, represented as [64.0] and does not return any value. It has 4993.0 func...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
kill_all_processes
def kill_all_processes(cls, session_dir: Path, os_user: str) -> None:"""Kill all existing VFS processes when outputs have been uploaded.:param session_dir: tmp directory for session:param os_user: the user running the job."""log.info("Terminating all VFS processes.")try:pid_file_path = (session_dir / DEADLINE_VFS_PID_F...
3
12
3
99
0
91
107
91
cls,session_dir,os_user
[]
None
{"Assign": 3, "Expr": 5, "For": 1, "Try": 1, "With": 1}
9
17
9
["log.info", "resolve", "open", "file.readlines", "line.strip", "line.split", "cls.shutdown_libfuse_mount", "os.remove", "log.warning"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.asset_sync_py.AssetSync.cleanup_session", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_a...
The function (kill_all_processes) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 91 and ends at 107. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [91.0] and does not return any value. It decla...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_shutdown_args
def get_shutdown_args(cls, mount_path: str, os_user: str):"""Return the argument list to provide the subprocess run command to shut down the mount:param mount_path: path to mounted folder:param os_user: the user running the job."""fusermount3_path = os.path.join(cls.find_vfs_link_dir(), "fusermount3")if not os.path.exi...
2
6
3
64
0
110
120
110
cls,mount_path,os_user
[]
Returns
{"Assign": 1, "Expr": 2, "If": 1, "Return": 2}
5
11
5
["os.path.join", "cls.find_vfs_link_dir", "os.path.exists", "log.warning", "cls.find_vfs_link_dir"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_vfs_py.TestVFSProcessmanager.test_pids_file_behavior", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud....
The function (get_shutdown_args) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 110 and ends at 120. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [110.0], and this function return a value. It d...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
shutdown_libfuse_mount
def shutdown_libfuse_mount(cls, mount_path: str, os_user: str, session_dir: Path) -> bool:"""Shut down the mount at the provided path using the fusermount3 unmount optionas the provided user:param mount_path: path to mounted folder"""log.info(f"Attempting to shut down {mount_path} as {os_user}")shutdown_args = cls.get_...
3
11
4
91
0
123
139
123
cls,mount_path,os_user,session_dir
[]
bool
{"Assign": 2, "Expr": 4, "If": 1, "Return": 2, "Try": 1}
6
17
6
["log.info", "cls.get_shutdown_args", "subprocess.run", "log.warning", "log.info", "cls.wait_for_mount"]
0
[]
The function (shutdown_libfuse_mount) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 123 and ends at 139. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [123.0] and does not return any value. It...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
kill_process_at_mount
def kill_process_at_mount(cls, session_dir: Path, mount_point: str, os_user: str) -> bool:"""Kill the VFS instance running at the given mount_point and modify the VFS pid trackingfile to remove the entry.:param session_dir: tmp directory for session:param mount_point: local directory to search for:param os_user: user t...
6
26
4
165
0
142
176
142
cls,session_dir,mount_point,os_user
[]
bool
{"AnnAssign": 1, "Assign": 5, "Expr": 7, "For": 1, "If": 3, "Return": 3, "Try": 1, "With": 2}
13
35
13
["cls.is_mount", "log.info", "log.info", "resolve", "open", "file.readlines", "open", "line.strip", "file.write", "line.split", "cls.shutdown_libfuse_mount", "file.write", "log.warning"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.download_py.handle_existing_vfs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachmen...
The function (kill_process_at_mount) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 142 and ends at 176. It contains 26 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [142.0] and does not return any value. It ...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_manifest_path_for_mount
def get_manifest_path_for_mount(cls, session_dir: Path, mount_point: str) -> Optional[Path]:"""Given a mount_point this searches the pid file for the associated manifest path.:param session_dir: tmp directory for session:param mount_point: local directory associated with the desired manifest:returns: Path to the manife...
5
17
3
120
0
179
204
179
cls,session_dir,mount_point
[]
Optional[Path]
{"Assign": 3, "Expr": 4, "For": 1, "If": 2, "Return": 3, "Try": 1, "With": 1}
10
26
10
["resolve", "open", "file.readlines", "line.strip", "line.split", "os.path.exists", "Path", "log.warning", "log.warning", "log.warning"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.download_py.handle_existing_vfs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachmen...
The function (get_manifest_path_for_mount) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 179 and ends at 204. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [179.0] and does not return any valu...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
is_mount
def is_mount(cls, path) -> bool:"""os.path.ismount returns false for libfuse mounts owned by "other users",use findmnt instead"""return subprocess.run(["findmnt", path]).returncode == 0
1
2
2
25
0
207
212
207
cls,path
[]
bool
{"Expr": 1, "Return": 1}
1
6
1
["subprocess.run"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.download_py.handle_existing_vfs"]
The function (is_mount) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 207 and ends at 212. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [207.0] and does not return any value. It declare 1.0 fu...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
wait_for_mount
def wait_for_mount(cls, mount_path, session_dir, mount_wait_seconds=60, expected=True) -> bool:"""After we've launched the VFS subprocess we need to waitfor the OS to validate that the mount is in place before use:param mount_path: Path to mount to watch for:param session_dir: Session folder associated with mount:param...
4
14
5
90
0
215
236
215
cls,mount_path,session_dir,mount_wait_seconds,expected
[]
bool
{"Assign": 1, "AugAssign": 1, "Expr": 7, "If": 2, "Return": 2, "While": 1}
7
22
7
["log.info", "cls.is_mount", "log.info", "log.info", "time.sleep", "log.info", "cls.print_log_end"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.vfs_py.VFSProcessManager.start"]
The function (wait_for_mount) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 215 and ends at 236. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [215.0] and does not return any value. It declare...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
logs_folder_path
def logs_folder_path(cls, session_dir: Path) -> Union[os.PathLike, str]:"""Find the folder we expect VFS logs to be written to"""return session_dir / VFS_LOGS_FOLDER_IN_SESSION
1
2
2
23
0
239
243
239
cls,session_dir
[]
Union[os.PathLike, str]
{"Expr": 1, "Return": 1}
0
5
0
[]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_vfs_py.test_vfs_has_expected_logs_folder"]
The function (logs_folder_path) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 239 and ends at 243. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [239.0] and does not return any value. It has 1....
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_logs_folder
def get_logs_folder(self) -> Union[os.PathLike, str]:"""Find the folder we expect VFS logs to be written to"""if self._run_path:return self.logs_folder_path(Path(self._run_path))raise VFSRunPathNotSetError("Attempted to find logs folder without run path")
2
4
1
37
0
245
251
245
self
[]
Union[os.PathLike, str]
{"Expr": 1, "If": 1, "Return": 1}
3
7
3
["self.logs_folder_path", "Path", "VFSRunPathNotSetError"]
0
[]
The function (get_logs_folder) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 245 and ends at 251. 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....
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
print_log_end
def print_log_end(self, session_dir: Path, log_file_name="vfs_log.txt", lines=100, log_level=logging.WARNING):"""Print out the end of our VFS Log.Reads the full log file into memory.Our VFS logs are sizecapped so this is not an issue for the intended use case.:param session_dir: Session folder for mount:param log_file_...
3
11
5
96
0
254
273
254
self,session_dir,log_file_name,lines,log_level
[]
None
{"Assign": 1, "Expr": 4, "For": 1, "If": 1, "Return": 1, "With": 1}
7
20
7
["self.logs_folder_path", "log.log", "os.path.exists", "log.warning", "open", "log_file.readlines", "log.log"]
0
[]
The function (print_log_end) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 254 and ends at 273. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [254.0] and does not return any value. It declares...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
find_vfs_link_dir
def find_vfs_link_dir(cls) -> str:"""Get the path where links to any necessary executables which should be added to the path should live:returns: Path to the link folder"""return os.path.join(os.path.dirname(VFSProcessManager.find_vfs()), "..", "link")
1
2
1
32
0
276
281
276
cls
[]
str
{"Expr": 1, "Return": 1}
3
6
3
["os.path.join", "os.path.dirname", "VFSProcessManager.find_vfs"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.vfs_py.VFSProcessManager.get_launch_environ"]
The function (find_vfs_link_dir) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 276 and ends at 281. 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 ...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
build_launch_command
def build_launch_command(self, mount_point: Union[os.PathLike, str]) -> str:"""Build command to pass to Popen to launch VFS:param mount_point: directory to mount which must be the first parameter seen by our executable:return: command"""executable = VFSProcessManager.find_vfs_launch_script()command = (f"sudo -E -u {sel...
3
16
2
75
0
283
305
283
self,mount_point
[]
str
{"Assign": 2, "AugAssign": 2, "Expr": 2, "If": 2, "Return": 1}
2
23
2
["VFSProcessManager.find_vfs_launch_script", "log.info"]
0
[]
The function (build_launch_command) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 283 and ends at 305. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [283.0] and does not return any value. It d...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
find_vfs_launch_script
def find_vfs_launch_script(cls) -> Union[os.PathLike, str]:"""Determine where the VFS launch script lives so we can build the launch command:return: Path to VFS launch script"""if VFSProcessManager.launch_script_path is not None:log.info(f"Using saved path {VFSProcessManager.launch_script_path} for launch script")retur...
4
21
1
126
0
308
337
308
cls
[]
Union[os.PathLike, str]
{"Assign": 5, "Expr": 8, "If": 3, "Return": 2}
8
30
8
["log.info", "log.info", "log.info", "log.warning", "os.path.exists", "log.info", "log.error", "log.error"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.vfs_py.VFSProcessManager.build_launch_command"]
The function (find_vfs_launch_script) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 308 and ends at 337. It contains 21 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 dec...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
find_vfs
def find_vfs(cls) -> Union[os.PathLike, str]:"""Determine where the VFS executable we'll be launching lives so we canfind the correct relative paths around it for LD_LIBRARY_PATH and config files:return: Path to VFS executable"""if VFSProcessManager.exe_path is not None:log.info(f"Using saved path {VFSProcessManager.ex...
7
30
1
193
0
340
381
340
cls
[]
Union[os.PathLike, str]
{"Assign": 8, "Expr": 10, "If": 6, "Return": 2}
15
42
15
["log.info", "shutil.which", "log.info", "os.getcwd", "log.info", "log.info", "os.path.exists", "log.info", "os.path.join", "os.getcwd", "os.path.exists", "log.info", "log.error", "log.info", "log.error"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.asset_sync_py.AssetSync._launch_vfs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments...
The function (find_vfs) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 340 and ends at 381. It contains 30 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters and does not return any value. It declares 15.0 fun...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_library_path
def get_library_path(cls) -> Union[os.PathLike, str]:"""Find our library dependencies which should be at ../lib relative to our executable"""if VFSProcessManager.library_path is None:exe_path = VFSProcessManager.find_vfs()VFSProcessManager.library_path = os.path.normpath(os.path.join(os.path.dirname(exe_path), "../lib"...
2
8
1
68
0
384
394
384
cls
[]
Union[os.PathLike, str]
{"Assign": 2, "Expr": 2, "If": 1, "Return": 1}
5
11
5
["VFSProcessManager.find_vfs", "os.path.normpath", "os.path.join", "os.path.dirname", "log.info"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.vfs_py.VFSProcessManager.get_launch_environ"]
The function (get_library_path) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 384 and ends at 394. It contains 8 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 5...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_file_path
def get_file_path(self, relative_file_name: str) -> Union[os.PathLike, str]:return os.path.join(self._mount_point, relative_file_name)
1
2
2
31
0
396
397
396
self,relative_file_name
[]
Union[os.PathLike, str]
{"Return": 1}
1
2
1
["os.path.join"]
0
[]
The function (get_file_path) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 396 and ends at 397. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [396.0] and does not return any value. It declare 1...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
create_mount_point
def create_mount_point(cls, mount_point: Union[os.PathLike, str]) -> None:"""By default fuse won't create our mount folder, create it if it doesn't exist"""if os.path.exists(mount_point) is False:log.info(f"Creating mount point at {mount_point}")os.makedirs(mount_point, exist_ok=True)log.info(f"Modifying permissions of...
2
6
2
67
0
400
408
400
cls,mount_point
[]
None
{"Expr": 5, "If": 1}
5
9
5
["os.path.exists", "log.info", "os.makedirs", "log.info", "os.chmod"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.vfs_py.VFSProcessManager.start"]
The function (create_mount_point) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 400 and ends at 408. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [400.0] and does not return any value. It decl...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_cwd
def get_cwd(cls) -> Union[os.PathLike, str]:"""Determine the cwd we should hand to Popen.We expect a config/logging.ini file to exist relative to this folder."""if VFSProcessManager.cwd_path is None:exe_path = VFSProcessManager.find_vfs()# Use cwd one folder up from binVFSProcessManager.cwd_path = os.path.normpath(os.p...
2
7
1
61
0
411
422
411
cls
[]
Union[os.PathLike, str]
{"Assign": 2, "Expr": 1, "If": 1, "Return": 1}
4
12
4
["VFSProcessManager.find_vfs", "os.path.normpath", "os.path.join", "os.path.dirname"]
0
[]
The function (get_cwd) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 411 and ends at 422. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functi...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_launch_environ
def get_launch_environ(self) -> dict:"""Get the environment variables we'll pass to the launch command.:returns: dictionary of default environment variables with VFS changes applied"""my_env = {**self._os_env_vars}my_env["PATH"] = f"{VFSProcessManager.find_vfs_link_dir()}{os.pathsep}{os.environ['PATH']}"my_env["LD_LIBR...
2
7
1
61
0
424
435
424
self
[]
dict
{"Assign": 4, "Expr": 1, "If": 1, "Return": 1}
4
12
4
["VFSProcessManager.find_vfs_link_dir", "VFSProcessManager.get_library_path", "os.environ.get", "os.environ.get"]
0
[]
The function (get_launch_environ) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 424 and ends at 435. It contains 7 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...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
set_manifest_owner
def set_manifest_owner(self) -> None:"""Set the manifest path to be owned by _os_user"""log.info(f"Attempting to set group ownership on {self._manifest_path} for {self._os_user} to {self._os_group}")if not os.path.exists(self._manifest_path):log.error(f"Manifest not found at {self._manifest_path}")returnif self._os_gro...
4
14
1
83
0
437
453
437
self
[]
None
{"Expr": 6, "If": 2, "Return": 1, "Try": 1}
6
17
6
["log.info", "os.path.exists", "log.error", "shutil.chown", "os.chmod", "log.error"]
0
[]
The function (set_manifest_owner) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 437 and ends at 453. It contains 14 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...
aws-deadline_deadline-cloud
public
public
0
0
start.read_output_thread
def read_output_thread(pipe, log):# Runs in a thread to redirect VFS output into our logtry:for line in pipe:log.info(line.decode("utf-8").strip())except Exception:log.exception("Error reading VFS output")
3
6
2
38
0
473
479
473
null
[]
None
null
0
0
0
null
0
null
The function (start.read_output_thread) defined within the public class called public.The function start at line 473 and ends at 479. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [473.0] and does not return any value..
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
start
def start(self, session_dir: Path) -> None:"""Start our VFS process:return: VFS process id"""self._run_path = session_dirlog.info(f"Using run_path {self._run_path}")log.info(f"Using mount_point {self._mount_point}")self.set_manifest_owner()VFSProcessManager.create_mount_point(self._mount_point)start_command = self.buil...
6
49
2
325
0
455
521
455
self,session_dir
[]
None
{"Assign": 9, "Expr": 18, "For": 2, "If": 2, "Try": 3, "With": 3}
33
67
33
["log.info", "log.info", "self.set_manifest_owner", "VFSProcessManager.create_mount_point", "self.build_launch_command", "self.get_launch_environ", "log.info", "log.info", "log.info", "log.info", "strip", "line.decode", "log.exception", "subprocess.Popen", "str", "threading.Thread", "self._vfs_thread.start", "log.excep...
142
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3527343_frigg_frigg_hq.frigg.projects.views_py.approve_projects", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3549150_freenas_cli.freenas.cli.functions_py.setinterval", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset...
The function (start) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 455 and ends at 521. It contains 49 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [455.0] and does not return any value. It declares 33.0 fu...
aws-deadline_deadline-cloud
VFSProcessManager
public
0
1
get_mount_point
def get_mount_point(self) -> Union[os.PathLike, str]:return self._mount_point
1
2
1
18
0
523
524
523
self
[]
Union[os.PathLike, str]
{"Return": 1}
0
2
0
[]
0
[]
The function (get_mount_point) defined within the public class called VFSProcessManager, that inherit another class.The function start at line 523 and ends at 524. 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..
aws-deadline_deadline-cloud
public
public
0
0
get_botocore_session
def get_botocore_session() -> botocore.session.Session:return botocore.session.get_session()
1
2
0
18
0
31
32
31
[]
botocore.session.Session
{"Return": 1}
1
2
1
["botocore.session.get_session"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._session_py._get_queue_user_boto3_session", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachment...
The function (get_botocore_session) defined within the public class called public.The function start at line 31 and ends at 32. 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 calle...
aws-deadline_deadline-cloud
public
public
0
0
get_boto3_session
def get_boto3_session(botocore_session: botocore.session.Session = get_botocore_session(),) -> boto3.session.Session:return boto3.session.Session(botocore_session=botocore_session)
1
4
1
33
0
36
39
36
botocore_session
[]
boto3.session.Session
{"Return": 1}
3
4
3
["get_botocore_session", "boto3.session.Session", "lru_cache"]
12
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._session_py.check_authentication_status", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._sess...
The function (get_boto3_session) defined within the public class called public.The function start at line 36 and ends at 39. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions calle...
aws-deadline_deadline-cloud
public
public
0
0
get_deadline_client
def get_deadline_client(session: Optional[boto3.session.Session] = None, endpoint_url: Optional[str] = None) -> BaseClient:"""Get a boto3 Deadline client to make API calls to Deadline"""if session is None:session = get_boto3_session()return session.client(VENDOR_CODE, endpoint_url=endpoint_url)
2
6
2
49
1
43
52
43
session,endpoint_url
['session']
BaseClient
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
3
10
3
["get_boto3_session", "session.client", "lru_cache"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._aws.deadline_py.get_job", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._aws.deadl...
The function (get_deadline_client) defined within the public class called public.The function start at line 43 and ends at 52. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [43.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions ...
aws-deadline_deadline-cloud
public
public
0
0
get_s3_client.add_expected_bucket_owner
def add_expected_bucket_owner(params, model, **kwargs):"""Add the expected bucket owner to the params if the API operation to run can use it."""if "ExpectedBucketOwner" in model.input_shape.members:params["ExpectedBucketOwner"] = get_account_id(session=session)
2
3
3
31
0
78
83
78
null
[]
None
null
0
0
0
null
0
null
The function (get_s3_client.add_expected_bucket_owner) defined within the public class called public.The function start at line 78 and ends at 83. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [78.0] and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
get_s3_client
def get_s3_client(session: Optional[boto3.Session] = None) -> BaseClient:"""Get a boto3 S3 client to make API calls to S3"""if session is None:session = get_boto3_session()s3_max_pool_connections = get_s3_max_pool_connections()client = session.client("s3",config=Config(signature_version="s3v4",connect_timeout=S3_CONNEC...
2
19
1
97
3
56
87
56
session
['client', 's3_max_pool_connections', 'session']
BaseClient
{"Assign": 4, "Expr": 3, "If": 2, "Return": 1}
7
32
7
["get_boto3_session", "get_s3_max_pool_connections", "session.client", "Config", "get_account_id", "client.meta.events.register", "lru_cache"]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._session_py.precache_clients", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._incrementa...
The function (get_s3_client) defined within the public class called public.The function start at line 56 and ends at 87. It contains 19 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 7.0 functions, It has 7.0 functions called i...
aws-deadline_deadline-cloud
public
public
0
0
get_s3_max_pool_connections
def get_s3_max_pool_connections() -> int:try:s3_max_pool_connections = int(config_file.get_setting("settings.s3_max_pool_connections"))except ValueError as ve:raise AssetSyncError("Failed to parse configuration settings. Please ensure that the following settings in the config file are integers: ""'s3_max_pool_connectio...
3
13
0
45
1
90
102
90
['s3_max_pool_connections']
int
{"Assign": 1, "If": 1, "Return": 1, "Try": 1}
4
13
4
["int", "config_file.get_setting", "AssetSyncError", "AssetSyncError"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._aws.aws_clients_py.get_s3_client", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.d...
The function (get_s3_max_pool_connections) defined within the public class called public.The function start at line 90 and ends at 102. It contains 13 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 fun...
aws-deadline_deadline-cloud
public
public
0
0
get_s3_transfer_manager
def get_s3_transfer_manager(s3_client: BaseClient):transfer_config = boto3.s3.transfer.TransferConfig()return create_transfer_manager(client=s3_client, config=transfer_config)
1
3
1
29
1
106
108
106
s3_client
['transfer_config']
Returns
{"Assign": 1, "Return": 1}
3
3
3
["boto3.s3.transfer.TransferConfig", "create_transfer_manager", "lru_cache"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._incremental_downloads._manifest_s3_downloads_py._download_file_with_transfer_manager", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_de...
The function (get_s3_transfer_manager) defined within the public class called public.The function start at line 106 and ends at 108. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, It has 3.0 fun...
aws-deadline_deadline-cloud
public
public
0
0
get_sts_client
def get_sts_client(session: Optional[boto3.session.Session] = None) -> BaseClient:"""Get a boto3 sts client to make API calls to STS."""if session is None:session = get_boto3_session()return session.client("sts",endpoint_url=f"https://sts.{session.region_name}.amazonaws.com",)
2
7
1
42
1
112
121
112
session
['session']
BaseClient
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
3
10
3
["get_boto3_session", "session.client", "lru_cache"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._aws.aws_clients_py.get_caller_identity", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_a...
The function (get_sts_client) defined within the public class called public.The function start at line 112 and ends at 121. It contains 7 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...
aws-deadline_deadline-cloud
public
public
0
0
get_caller_identity
def get_caller_identity(session: Optional[boto3.session.Session] = None) -> dict[str, str]:"""Get the caller identity for the current session."""return get_sts_client(session).get_caller_identity()
1
2
1
33
0
125
129
125
session
[]
dict[str, str]
{"Expr": 1, "Return": 1}
3
5
3
["get_caller_identity", "get_sts_client", "lru_cache"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.tsbench.src.tsbench.evaluations.aws.session_py.account_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._se...
The function (get_caller_identity) defined within the public class called public.The function start at line 125 and ends at 129. 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 3.0 functions, It has 3.0 functions c...
aws-deadline_deadline-cloud
public
public
0
0
get_account_id
def get_account_id(session: Optional[boto3.session.Session] = None) -> str:"""Get the account id for the current session."""return get_caller_identity(session)["Account"]
1
2
1
27
0
132
136
132
session
[]
str
{"Expr": 1, "Return": 1}
1
5
1
["get_caller_identity"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._aws.aws_clients_py.get_s3_client", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._...
The function (get_account_id) defined within the public class called public.The function start at line 132 and ends at 136. 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 in...
aws-deadline_deadline-cloud
public
public
0
0
get_queue
def get_queue(farm_id: str,queue_id: str,session: Optional[boto3.Session] = None,deadline_endpoint_url: Optional[str] = None,) -> Queue:"""Retrieves a specific queue from AWS Deadline Cloud."""try:response = get_deadline_client(session=session, endpoint_url=deadline_endpoint_url).get_queue(farmId=farm_id, queueId=queue...
6
35
4
194
4
23
65
23
farm_id,queue_id,session,deadline_endpoint_url
['display_name_key', 'status_key', 'job_attachment_settings', 'response']
Queue
{"Assign": 7, "Expr": 1, "If": 3, "Return": 1, "Try": 1}
9
43
9
["get_queue", "get_deadline_client", "JobAttachmentsError", "response.get", "get", "JobAttachmentS3Settings", "get", "get", "Queue"]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.scripted_tests.download_cancel_test_py.test_download_outputs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.scripted_tests.download_cancel_t...
The function (get_queue) defined within the public class called public.The function start at line 23 and ends at 65. It contains 35 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [23.0] and does not return any value. It declares 9.0 functions, It has 9.0 functions called in...
aws-deadline_deadline-cloud
public
public
0
0
get_job
def get_job(farm_id: str,queue_id: str,job_id: str,session: Optional[boto3.Session] = None,deadline_endpoint_url: Optional[str] = None,) -> Job:"""Retrieves a specific job from AWS Deadline Cloud."""try:response = get_deadline_client(session=session, endpoint_url=deadline_endpoint_url).get_job(farmId=farm_id, queueId=q...
5
39
5
200
1
68
109
68
farm_id,queue_id,job_id,session,deadline_endpoint_url
['response']
Job
{"Assign": 1, "Expr": 1, "Return": 1, "Try": 1}
12
42
12
["get_job", "get_deadline_client", "JobAttachmentsError", "Job", "Attachments", "ManifestProperties", "manifest_properties.get", "PathFormat", "manifest_properties.get", "manifest_properties.get", "JobAttachmentsFileSystem", "get"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.scripted_tests.download_cancel_test_py.test_sync_inputs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.scripted_tests.sync_inputs_with_step_...
The function (get_job) defined within the public class called public.The function start at line 68 and ends at 109. It contains 39 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [68.0] and does not return any value. It declares 12.0 functions, It has 12.0 functions called i...
aws-deadline_deadline-cloud
public
public
0
0
_add_output_manifests_from_s3
def _add_output_manifests_from_s3(farm_id: str,queue: dict[str, Any],job: dict[str, Any],boto3_session: boto3.Session,session_action_list: list[dict[str, Any]],):"""This function takes a list of session actions (as returned by boto3 deadline.list_session_actions),and for any that lack manifest fields, updates them with...
18
77
5
361
11
81
199
81
farm_id,queue,job,boto3_session,session_action_list
['root_path_hashes', 'manifest_session_action_id', 'job_manifests_length', 'job_indexed_root_path_hash', 'session_action_for_key', 'output_manifest_path', 'm', 'session_action_list', 'manifest_prefix', 's3_settings', 'manifests_index']
None
{"AnnAssign": 3, "Assign": 15, "Expr": 1, "For": 3, "If": 8, "Return": 3, "Try": 1}
17
119
17
["JobAttachmentS3Settings", "len", "ja_hash_data", "encode", "manifest.get", "enumerate", "_get_output_manifest_prefix", "_get_tasks_manifests_keys_from_s3", "startswith", "str", "SESSION_ACTION_ID_FROM_KEY_RE.search", "RuntimeError", "RuntimeError", "join", "session_actions_by_session_action_id.get", "output_manifest_...
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._add_missing_output_manifests_to_job_sessions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_clou...
The function (_add_output_manifests_from_s3) defined within the public class called public.The function start at line 81 and ends at 199. It contains 77 lines of code and it has a cyclomatic complexity of 18. It takes 5 parameters, represented as [81.0] and does not return any value. It declares 17.0 functions, It has ...
aws-deadline_deadline-cloud
public
public
0
0
_download_manifest_and_make_paths_absolute
def _download_manifest_and_make_paths_absolute(index: int,queue: dict[str, Any],job_id: str,root_path: str,manifest_s3_key: str,path_mapping_rule_applier: Optional[_PathMappingRuleApplier],boto3_session_for_s3: boto3.Session,output_manifests: list,output_unmapped_paths: list[tuple[str, str]],):"""Downloads the specifie...
7
37
9
199
2
202
248
202
index,queue,job_id,root_path,manifest_s3_key,path_mapping_rule_applier,boto3_session_for_s3,output_manifests,output_unmapped_paths
['source_os_path', 'new_manifest_paths']
None
{"AnnAssign": 1, "Assign": 8, "Expr": 3, "For": 1, "If": 4, "Try": 1}
7
47
7
["_get_asset_root_and_manifest_from_s3_with_last_modified", "source_os_path.normpath", "source_os_path.join", "str", "path_mapping_rule_applier.strict_transform", "new_manifest_paths.append", "output_unmapped_paths.append"]
0
[]
The function (_download_manifest_and_make_paths_absolute) defined within the public class called public.The function start at line 202 and ends at 248. It contains 37 lines of code and it has a cyclomatic complexity of 7. It takes 9 parameters, represented as [202.0] and does not return any value. It declares 7.0 funct...
aws-deadline_deadline-cloud
public
public
0
0
_get_manifests_to_download
def _get_manifests_to_download(job_attachments_root_prefix: str,download_candidate_jobs: dict[str, dict[str, Any]],job_sessions: dict[str, list],path_mapping_rule_appliers: dict[str, Optional[_PathMappingRuleApplier]],) -> list[tuple[Optional[_PathMappingRuleApplier], str, str, str]]:"""Collect a list of (pathMappingRu...
7
32
4
188
1
251
299
251
job_attachments_root_prefix,download_candidate_jobs,job_sessions,path_mapping_rule_appliers
['job']
list[tuple[Optional[_PathMappingRuleApplier], str, str, str]]
{"AnnAssign": 1, "Assign": 1, "Expr": 2, "For": 4, "If": 1, "Return": 1}
5
49
5
["job_sessions.items", "session.get", "zip", "manifests_to_download.append", "join"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._incremental_downloads._manifest_s3_downloads_py._download_all_manifests_with_absolute_paths"]
The function (_get_manifests_to_download) defined within the public class called public.The function start at line 251 and ends at 299. It contains 32 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [251.0] and does not return any value. It declares 5.0 functions, It has 5.0...
aws-deadline_deadline-cloud
public
public
0
0
_download_all_manifests_with_absolute_paths
def _download_all_manifests_with_absolute_paths(queue: dict[str, Any],download_candidate_jobs: dict[str, dict[str, Any]],job_sessions: dict[str, list],path_mapping_rule_appliers: dict[str, Optional[_PathMappingRuleApplier]],output_unmapped_paths: dict[str, list[str]],boto3_session_for_s3: boto3.Session,print_function_c...
4
50
8
311
4
302
382
302
queue,download_candidate_jobs,job_sessions,path_mapping_rule_appliers,output_unmapped_paths,boto3_session_for_s3,print_function_callback
['max_workers', 'start_time', 'duration', 'futures']
list[tuple[datetime, BaseAssetManifest]]
{"AnnAssign": 3, "Assign": 4, "Expr": 8, "For": 3, "Return": 1, "With": 1}
17
81
17
["_get_manifests_to_download", "print_function_callback", "print_function_callback", "len", "datetime.now", "len", "print_function_callback", "concurrent.futures.ThreadPoolExecutor", "enumerate", "futures.append", "executor.submit", "concurrent.futures.as_completed", "future.result", "append", "output_unmapped_paths.se...
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._incremental_output_download", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadl...
The function (_download_all_manifests_with_absolute_paths) defined within the public class called public.The function start at line 302 and ends at 382. It contains 50 lines of code and it has a cyclomatic complexity of 4. It takes 8 parameters, represented as [302.0] and does not return any value. It declares 17.0 fun...
aws-deadline_deadline-cloud
public
public
0
0
_merge_absolute_path_manifest_list
def _merge_absolute_path_manifest_list(downloaded_manifests: list[tuple[datetime, BaseAssetManifest]],) -> list[BaseManifestPath]:"""Given a list of manifests that contain absolute paths, uses the provided last modified timestampsto sort them, and merges them all into a single manifest. Returns the list of manifest pat...
3
9
1
78
1
385
412
385
downloaded_manifests
['merged_manifest_paths_dict']
list[BaseManifestPath]
{"Assign": 2, "Expr": 2, "For": 2, "Return": 1}
4
28
4
["downloaded_manifests.sort", "os.path.normcase", "list", "merged_manifest_paths_dict.values"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._incremental_output_download", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadl...
The function (_merge_absolute_path_manifest_list) defined within the public class called public.The function start at line 385 and ends at 412. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has ...
aws-deadline_deadline-cloud
public
public
0
0
_download_file_with_transfer_manager.handler
def handler(bytes_downloaded):nonlocal progress_trackernonlocal futureshould_continue = progress_tracker.track_progress_callback(bytes_downloaded)if not should_continue:future.cancel()
2
6
1
26
0
431
437
431
null
[]
None
null
0
0
0
null
0
null
The function (_download_file_with_transfer_manager.handler) defined within the public class called public.The function start at line 431 and ends at 437. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
_download_file_with_transfer_manager
def _download_file_with_transfer_manager(local_file_path: Path,s3_bucket: str,s3_key: str,boto3_session: boto3.Session,s3_client: BaseClient,progress_tracker: ProgressTracker,):"""Downloads a single file from S3 using S3 transfer manager. This is appropriate for a largerfile that benefits from parallel multi-part downl...
1
20
6
100
4
415
449
415
local_file_path,s3_bucket,s3_key,boto3_session,s3_client,progress_tracker
['subscribers', 'should_continue', 'future', 'transfer_manager']
None
{"AnnAssign": 1, "Assign": 4, "Expr": 3, "If": 1}
8
35
8
["get_s3_transfer_manager", "progress_tracker.track_progress_callback", "future.cancel", "ProgressCallbackInvoker", "transfer_manager.download", "str", "get_account_id", "future.result"]
0
[]
The function (_download_file_with_transfer_manager) defined within the public class called public.The function start at line 415 and ends at 449. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [415.0] and does not return any value. It declares 8.0 functions, ...
aws-deadline_deadline-cloud
public
public
0
0
_download_file_with_get_object
def _download_file_with_get_object(local_file_path: Path,s3_bucket: str,s3_key: str,boto3_session: boto3.Session,s3_client: BaseClient,progress_tracker: ProgressTracker,):"""Downloads a single file from S3 using get_object. This is appropriate for a smallerfile that benefits from reduced overhead."""res = s3_client.get...
4
26
6
129
5
452
482
452
local_file_path,s3_bucket,s3_key,boto3_session,s3_client,progress_tracker
['res', 'body', 'buffer_size', 'should_continue', 'data']
None
{"Assign": 5, "Expr": 4, "If": 2, "While": 1, "With": 1}
10
31
10
["s3_client.get_object", "get_account_id", "open", "body.read", "progress_tracker.track_progress_callback", "len", "fh.close", "os.remove", "AssetSyncCancelledError", "fh.write"]
0
[]
The function (_download_file_with_get_object) defined within the public class called public.The function start at line 452 and ends at 482. It contains 26 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [452.0] and does not return any value. It declares 10.0 functions, and ...
aws-deadline_deadline-cloud
public
public
0
0
_download_file
def _download_file(file: BaseManifestPath,hash_algorithm: HashAlgorithm,collision_lock: Lock,collision_file_dict: DefaultDict[str, int],s3_bucket: str,cas_prefix: str,s3_client: BaseClient,boto3_session_for_s3: boto3.Session,progress_tracker: ProgressTracker,file_conflict_resolution: FileConflictResolution,) -> None:""...
14
87
10
366
7
485
597
485
file,hash_algorithm,collision_lock,collision_file_dict,s3_bucket,cas_prefix,s3_client,boto3_session_for_s3,progress_tracker,file_conflict_resolution
['s3_key', 'download_file', 'status_code', 'file_size_on_disk', 'modified_time_override', 'status_code_guidance', 'local_file_path']
None
{"Assign": 9, "Expr": 4, "If": 7, "Return": 1, "Try": 1}
20
113
20
["_get_long_path_compatible_path", "local_file_path.is_file", "_get_new_copy_file_path", "ValueError", "local_file_path.parent.mkdir", "download_file", "AssetSyncCancelledError", "AssetSyncError", "int", "str", "JobAttachmentsS3ClientError", "status_code_guidance.get", "str", "str", "JobAttachmentS3BotoCoreError", "str...
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3926305_ableton_groovylint.run_codenarc_py._download_jar_with_retry", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3926305_ableton_groovylint.tests.test_run_codenarc_py.test_download_file_4xx", "_.content.gdrive.My...
The function (_download_file) defined within the public class called public.The function start at line 485 and ends at 597. It contains 87 lines of code and it has a cyclomatic complexity of 14. It takes 10 parameters, represented as [485.0] and does not return any value. It declares 20.0 functions, It has 20.0 functio...
aws-deadline_deadline-cloud
public
public
0
0
_download_manifest_paths
def _download_manifest_paths(manifest_paths_to_download: list[BaseManifestPath],hash_algorithm: HashAlgorithm,queue: dict[str, Any],boto3_session_for_s3: boto3.Session,file_conflict_resolution: FileConflictResolution,on_downloading_files: Optional[Callable[[ProgressReportMetadata], bool]],print_function_callback: Calla...
6
46
8
251
5
600
663
600
manifest_paths_to_download,hash_algorithm,queue,boto3_session_for_s3,file_conflict_resolution,on_downloading_files,print_function_callback
['futures', 's3_client', 'progress_tracker', 's3_settings', 'max_workers']
None
{"AnnAssign": 3, "Assign": 5, "Expr": 6, "For": 1, "If": 2, "With": 1}
17
64
17
["JobAttachmentS3Settings", "get_s3_client", "_get_num_download_workers", "Lock", "DefaultDict", "s3_settings.full_cas_prefix", "ProgressTracker", "len", "sum", "print_function_callback", "concurrent.futures.ThreadPoolExecutor", "executor.submit", "concurrent.futures.as_completed", "future.result", "progress_tracker.in...
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._incremental_output_download", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadl...
The function (_download_manifest_paths) defined within the public class called public.The function start at line 600 and ends at 663. It contains 46 lines of code and it has a cyclomatic complexity of 6. It takes 8 parameters, represented as [600.0] and does not return any value. It declares 17.0 functions, It has 17.0...
aws-deadline_deadline-cloud
public
public
0
0
_datetimes_to_str
def _datetimes_to_str(obj: Any) -> Any:"""Recursively applies the isoformat() function to all datetimes in the object"""if isinstance(obj, datetime):return obj.isoformat()elif isinstance(obj, list):return [_datetimes_to_str(item) for item in obj]elif isinstance(obj, dict):return {key: _datetimes_to_str(value) for key, ...
6
9
1
74
0
17
26
17
obj
[]
Any
{"Expr": 1, "If": 3, "Return": 4}
7
10
7
["isinstance", "obj.isoformat", "isinstance", "_datetimes_to_str", "isinstance", "_datetimes_to_str", "obj.items"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._get_download_candidate_jobs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.jo...
The function (_datetimes_to_str) defined within the public class called public.The function start at line 17 and ends at 26. It contains 9 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 7.0 functions, It has 7.0 functions calle...
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
__init__
def __init__(self,job: dict[str, Any],session_ended_timestamp: Optional[datetime],session_completed_indexes: Optional[dict[str, int]],):"""Initialize a Job instance.Args:job (dict[str, Any]): The job as returned by boto3 from deadline:SearchJobs.session_ended_timestamp (Optional[datetime]): The largest endedAt timestam...
2
9
4
56
0
40
57
40
self,job,session_ended_timestamp,session_completed_indexes
[]
None
{"Assign": 3, "Expr": 1}
1
18
1
["_datetimes_to_str"]
4,993
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.logging_py.LoggerHandler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.schedule_...
The function (__init__) defined within the public class called IncrementalDownloadJob.The function start at line 40 and ends at 57. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [40.0] and does not return any value. It declare 1.0 function, It has 1.0 functio...
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
job_id
def job_id(self) -> str:return self.job["jobId"]
1
2
1
14
0
60
61
60
self
[]
str
{"Return": 1}
0
2
0
[]
0
[]
The function (job_id) defined within the public class called IncrementalDownloadJob.The function start at line 60 and ends at 61. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
from_dict
def from_dict(cls, data: dict[str, Any]) -> "IncrementalDownloadJob":"""Create a Job instance from a dictionary.Args:data (dict): Dictionary containing job dataReturns:Job: A new instance populated with the data"""if not isinstance(data, dict):raise ValueError("Input must be a dict.")missing_fields = [field for field i...
6
18
2
114
0
64
89
64
cls,data
[]
'IncrementalDownloadJob'
{"Assign": 4, "Expr": 1, "If": 2, "Return": 1}
7
26
7
["isinstance", "ValueError", "ValueError", "data.get", "data.get", "datetime.fromisoformat", "cls"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._incremental_downloads.incremental_download_state_py.IncrementalDownloadState.from_dict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95188692_yuru...
The function (from_dict) defined within the public class called IncrementalDownloadJob.The function start at line 64 and ends at 89. It contains 18 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [64.0] and does not return any value. It declares 7.0 functions, It has 7.0 fun...
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
to_dict
def to_dict(self) -> dict[str, Any]:"""Convert the Job to a dictionary.Returns:dict: Dictionary representation of the job"""result: dict[str, Any] = {"job": self.job,}if self.session_ended_timestamp is not None:result["sessionEndedTimestamp"] = self.session_ended_timestamp.isoformat()if self.session_completed_indexes !...
3
9
1
68
0
91
104
91
self
[]
dict[str, Any]
{"AnnAssign": 1, "Assign": 2, "Expr": 1, "If": 2, "Return": 1}
1
14
1
["self.session_ended_timestamp.isoformat"]
35
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957978_dgilland_pydash.src.pydash.objects_py.omit_by", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957978_dgilland_pydash.src.pydash.objects_py.pick_by", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Out...
The function (to_dict) defined within the public class called IncrementalDownloadJob.The function start at line 91 and ends at 104. It contains 9 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 declare 1.0 function, It has 1.0 function c...
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
__init__
def __init__(self,local_storage_profile_id: Optional[str],downloads_started_timestamp: datetime,downloads_completed_timestamp: Optional[datetime] = None,jobs: Optional[list] = None,eventual_consistency_max_seconds: Optional[int] = None,):"""Initialize a IncrementalDownloadState instance. To bootstrap the state, constru...
4
17
6
89
0
154
184
154
self,job,session_ended_timestamp,session_completed_indexes
[]
None
{"Assign": 3, "Expr": 1}
1
18
1
["_datetimes_to_str"]
4,993
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.logging_py.LoggerHandler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.schedule_...
The function (__init__) defined within the public class called IncrementalDownloadJob.The function start at line 154 and ends at 184. It contains 17 lines of code and it has a cyclomatic complexity of 4. It takes 6 parameters, represented as [154.0] and does not return any value. It declare 1.0 function, It has 1.0 fun...
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
from_dict
def from_dict(cls, data):"""Create a IncrementalDownloadState instance from a dictionary.Args:data (dict): Dictionary containing state file dataReturns:IncrementalDownloadState: A new instance populated with the data"""if not isinstance(data, dict):raise ValueError("Input must be a dict.")missing_fields = [field for fi...
6
15
2
110
0
187
209
187
cls,data
[]
'IncrementalDownloadJob'
{"Assign": 4, "Expr": 1, "If": 2, "Return": 1}
7
26
7
["isinstance", "ValueError", "ValueError", "data.get", "data.get", "datetime.fromisoformat", "cls"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments._incremental_downloads.incremental_download_state_py.IncrementalDownloadState.from_dict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95188692_yuru...
The function (from_dict) defined within the public class called IncrementalDownloadJob.The function start at line 187 and ends at 209. It contains 15 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [187.0] and does not return any value. It declares 7.0 functions, It has 7.0 ...
aws-deadline_deadline-cloud
IncrementalDownloadJob
public
0
0
to_dict
def to_dict(self):"""Convert the IncrementalDownloadState to a dictionary.Returns:dict: Dictionary representation of the state file model"""result = {"localStorageProfileId": self.local_storage_profile_id,"downloadsStartedTimestamp": self.downloads_started_timestamp.isoformat(),"eventualConsistencyMaxSeconds": self.eve...
3
10
1
70
0
211
226
211
self
[]
dict[str, Any]
{"AnnAssign": 1, "Assign": 2, "Expr": 1, "If": 2, "Return": 1}
1
14
1
["self.session_ended_timestamp.isoformat"]
35
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957978_dgilland_pydash.src.pydash.objects_py.omit_by", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957978_dgilland_pydash.src.pydash.objects_py.pick_by", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Out...
The function (to_dict) defined within the public class called IncrementalDownloadJob.The function start at line 211 and ends at 226. 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 declare 1.0 function, It has 1.0 function...
aws-deadline_deadline-cloud
IncrementalDownloadState
public
0
0
from_file
def from_file(cls,file_path: str,) -> "IncrementalDownloadState":"""Loads progress from state file saved at saved_progress_checkpoint_full_path:param saved_progress_checkpoint_full_path: full path of the saved progress checkpoint file:param print_function_callback: Callback to print messages produced in this function.U...
1
9
2
47
0
229
246
229
cls,file_path
[]
'IncrementalDownloadState'
{"AnnAssign": 1, "Assign": 2, "Expr": 1, "Return": 1, "With": 1}
3
18
3
["open", "json.load", "IncrementalDownloadState.from_dict"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.queue_group_py.sync_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments...
The function (from_file) defined within the public class called IncrementalDownloadState.The function start at line 229 and ends at 246. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [229.0] and does not return any value. It declares 3.0 functions, It has 3.0...
aws-deadline_deadline-cloud
IncrementalDownloadState
public
0
0
save_file
def save_file(self,file_path: str,) -> None:"""Save the current download progress to a state file atomically.:param file_path: Where to save the file.:param print_function_callback: Callback to print messages produced in this function.Used in the CLI to print to stdout using click.echo. By default, ignores messages:ret...
1
16
2
100
0
248
277
248
self,file_path
[]
None
{"Assign": 2, "Expr": 4, "With": 1}
7
30
7
["os.path.dirname", "os.makedirs", "self.to_dict", "tempfile.NamedTemporaryFile", "os.path.basename", "json.dump", "os.replace"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.86980582_aws_neuron_transformers_neuronx.src.transformers_neuronx.decoder_py.DecoderLayer.save_presharded_weights", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.86980582_aws_neuron_transformers_neuronx.src.transfor...
The function (save_file) defined within the public class called IncrementalDownloadState.The function start at line 248 and ends at 277. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [248.0] and does not return any value. It declares 7.0 functions, It has 7....
aws-deadline_deadline-cloud
public
public
0
0
_read_manifests
def _read_manifests(manifest_paths: List[str]) -> Dict[str, BaseAssetManifest]:"""Read in manfiests from the given file path list, and produce file name to manifest mapping.Args:manifest_paths (List[str]): List of file paths to manifest file.Raises:NonValidInputError: Raise when any of the file is not valid.Returns:Dic...
5
11
1
94
0
13
38
13
manifest_paths
[]
Dict[str, BaseAssetManifest]
{"AnnAssign": 1, "Expr": 1, "If": 1, "Return": 1, "With": 1}
8
26
8
["os.path.isfile", "NonValidInputError", "ExitStack", "os.path.basename", "decode_manifest", "read", "stack.enter_context", "open"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.api.attachment_py._attachment_download", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachme...
The function (_read_manifests) defined within the public class called public.The function start at line 13 and ends at 38. It contains 11 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 8.0 functions, It has 8.0 functions called...
aws-deadline_deadline-cloud
public
public
0
0
_attachment_download
def _attachment_download(manifests: List[str],s3_root_uri: str,boto3_session: boto3.Session,path_mapping_rules: Optional[str] = None,logger: ClickLogger = ClickLogger(False),conflict_resolution: FileConflictResolution = FileConflictResolution.CREATE_COPY,):"""BETA API - This API is still evolving.API to download job at...
1
22
5
91
0
27
67
27
manifests,s3_root_uri,boto3_session,path_mapping_rules,logger,conflict_resolution
[]
None
{"AnnAssign": 2, "Expr": 2}
4
41
4
["ClickLogger", "_read_manifests", "_process_path_mapping", "_attachment_download_with_root_manifests"]
8
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.attachment_group_py.attachment_download", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_jo...
The function (_attachment_download) defined within the public class called public.The function start at line 27 and ends at 67. It contains 22 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [27.0] and does not return any value. It declares 4.0 functions, It has 4.0 function...
aws-deadline_deadline-cloud
public
public
0
0
_attachment_download_with_root_manifests
def _attachment_download_with_root_manifests(boto3_session: boto3.Session,file_name_manifest_dict: Dict[str, BaseAssetManifest],s3_root_uri: str,conflict_resolution: FileConflictResolution,path_mapping_rule_list: Optional[List[PathMappingRule]] = None,logger: ClickLogger = ClickLogger(False),):"""Function to use for at...
6
33
6
190
1
70
124
70
boto3_session,file_name_manifest_dict,s3_root_uri,conflict_resolution,path_mapping_rule_list,logger
['destination']
None
{"AnnAssign": 3, "Assign": 2, "Expr": 3, "For": 1, "If": 1}
16
55
16
["ClickLogger", "dict", "file_name_manifest_dict.items", "next", "rule.get_hashed_source_path", "manifest.get_default_hash_alg", "os.getcwd", "merged_manifests_by_root.get", "NonValidInputError", "JobAttachmentS3Settings.from_s3_root_uri", "download_files_from_manifests", "s3_settings.full_cas_prefix", "logger.echo", "...
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.api.attachment_py._attachment_download"]
The function (_attachment_download_with_root_manifests) defined within the public class called public.The function start at line 70 and ends at 124. It contains 33 lines of code and it has a cyclomatic complexity of 6. It takes 6 parameters, represented as [70.0] and does not return any value. It declares 16.0 function...
aws-deadline_deadline-cloud
public
public
0
0
_attachment_upload
def _attachment_upload(manifests: List[str],s3_root_uri: str,boto3_session: boto3.Session,root_dirs: List[str] = [],path_mapping_rules: Optional[str] = None,manifest_path_mapping: Optional[Dict[str, str]] = None,upload_manifest_path: Optional[str] = None,logger: ClickLogger = ClickLogger(False),) -> List[UploadManifest...
8
67
8
386
3
127
235
127
manifests,s3_root_uri,boto3_session,root_dirs,path_mapping_rules,manifest_path_mapping,upload_manifest_path,logger
['manifest_info_list', 'metadata', 'file_name']
List[UploadManifestInfo]
{"AnnAssign": 6, "Assign": 7, "Expr": 4, "For": 1, "If": 3, "Return": 1, "Try": 1}
24
109
24
["ClickLogger", "_read_manifests", "bool", "bool", "NonValidInputError", "_process_path_mapping", "JobAttachmentS3Settings.from_s3_root_uri", "S3AssetUploader", "os.path.basename", "next", "rule.get_hashed_source_path", "manifest.get_default_hash_alg", "NonValidInputError", "json.dumps", "rule.source_path.encode", "jso...
10
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.attachment_group_py.attachment_upload", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_...
The function (_attachment_upload) defined within the public class called public.The function start at line 127 and ends at 235. It contains 67 lines of code and it has a cyclomatic complexity of 8. It takes 8 parameters, represented as [127.0] and does not return any value. It declares 24.0 functions, It has 24.0 funct...
aws-deadline_deadline-cloud
public
public
0
0
_process_path_mapping
def _process_path_mapping(path_mapping_rules: Optional[str] = None, root_dirs: List[str] = []) -> List[PathMappingRule]:"""Process list of path mapping rules from the input path mapping file or root directories.Args:path_mapping_rules (Optional[str], optional): File path to path mapping rules. Defaults to None.root_dir...
9
22
2
166
1
238
278
238
path_mapping_rules,root_dirs
['data']
List[PathMappingRule]
{"AnnAssign": 1, "Assign": 2, "Expr": 3, "If": 4, "Return": 1, "With": 1}
12
41
12
["list", "os.path.isfile", "NonValidInputError", "open", "json.load", "isinstance", "path_mapping_rule_list.extend", "PathMappingRule", "os.path.isdir", "NonValidInputError", "path_mapping_rule_list.extend", "PathMappingRule"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.api.attachment_py._attachment_download", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachme...
The function (_process_path_mapping) defined within the public class called public.The function start at line 238 and ends at 278. It contains 22 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [238.0] and does not return any value. It declares 12.0 functions, It has 12.0 fu...
aws-deadline_deadline-cloud
public
public
0
0
_glob_files
def _glob_files(root: str,include: Optional[List[str]] = None,exclude: Optional[List[str]] = None,include_exclude_config: Optional[str] = None,) -> List[str]:""":param include: Include glob to look for files to add to the manifest.:param exclude: Exclude glob to exclude files from the manifest.:param include_exclude_co...
6
19
4
126
4
55
83
55
root,include,exclude,include_exclude_config
['exclude', 'glob_config', 'include', 'input_files']
List[str]
{"AnnAssign": 1, "Assign": 6, "Expr": 1, "If": 2, "Return": 1}
5
29
5
["default_glob_all", "GlobConfig", "_process_glob_inputs", "GlobConfig", "_glob_paths"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.manifest_group_py.manifest_diff", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments....
The function (_glob_files) defined within the public class called public.The function start at line 55 and ends at 83. It contains 19 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [55.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions called ...
aws-deadline_deadline-cloud
public
public
0
0
_manifest_snapshot
def _manifest_snapshot(root: str,destination: str,name: str,include: Optional[List[str]] = None,exclude: Optional[List[str]] = None,include_exclude_config: Optional[str] = None,diff: Optional[str] = None,force_rehash: bool = False,logger: ClickLogger = ClickLogger(False),) -> Optional[ManifestSnapshot]:# Get all files ...
18
78
9
446
9
86
185
86
root,destination,name,include,exclude,include_exclude_config,diff,force_rehash,logger
['output_manifest', 'current_files', 'include', 'source_manifest', 'local_manifest_file', 'source_manifest_str', 'full_diff_path', 'glob_config', 'exclude']
Optional[ManifestSnapshot]
{"AnnAssign": 4, "Assign": 13, "Expr": 5, "For": 2, "If": 11, "Return": 6, "With": 1}
22
100
22
["ClickLogger", "default_glob_all", "GlobConfig", "_process_glob_inputs", "GlobConfig", "_glob_paths", "_create_manifest_for_single_root", "open", "source_diff.read", "decode_manifest", "_fast_file_list_to_manifest_diff", "changed_paths.append", "_create_manifest_for_single_root", "compare_manifest", "changed_paths.app...
13
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.manifest_group_py.manifest_snapshot", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.integ.cli.test_cli_m...
The function (_manifest_snapshot) defined within the public class called public.The function start at line 86 and ends at 185. It contains 78 lines of code and it has a cyclomatic complexity of 18. It takes 9 parameters, represented as [86.0] and does not return any value. It declares 22.0 functions, It has 22.0 functi...
aws-deadline_deadline-cloud
public
public
0
0
_write_manifest
def _write_manifest(root: str,manifest: BaseAssetManifest,destination: str,name: Optional[str] = None,) -> str:"""Write a manifest to a destination."""# Write created manifest into local file, at the specified location at destinationroot_hash: str = hash_data(root.encode("utf-8"), manifest.get_default_hash_alg())timest...
3
20
4
167
3
188
213
188
root,manifest,destination,name
['timestamp', 'manifest_name', 'local_manifest_path']
str
{"AnnAssign": 1, "Assign": 5, "Expr": 3, "Return": 1, "With": 1}
16
26
16
["hash_data", "root.encode", "manifest.get_default_hash_alg", "strftime", "datetime.datetime.now", "replace", "replace", "root.replace", "str", "_get_long_path_compatible_path", "os.path.join", "os.makedirs", "os.path.dirname", "open", "file.write", "manifest.encode"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.api.manifest_py._manifest_merge", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.job_attachments.api...
The function (_write_manifest) defined within the public class called public.The function start at line 188 and ends at 213. It contains 20 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [188.0] and does not return any value. It declares 16.0 functions, It has 16.0 function...