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
public
public
0
0
cli_fleet
def cli_fleet():"""Commands to work with fleets."""
1
1
0
5
0
19
22
19
[]
None
{"Expr": 1}
1
4
1
["main.group"]
0
[]
The function (cli_fleet) defined within the public class called public.The function start at line 19 and ends at 22. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called inside which is ["main.group"].
aws-deadline_deadline-cloud
public
public
0
0
fleet_list
def fleet_list(**args):"""Lists the available fleets."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)try:response = api.list_fleets(farmId=farm_id, config=config)except ClientError as exc:raise DeadlineOperationError(f"Failed to get Fleets from Deadline:\n{exc}") from exc# Select which fields to print and in which orderstructured_fleet_list = [{field: fleet[field] for field in ["fleetId", "displayName"]}for fleet in response["fleets"]]click.echo(_cli_object_repr(structured_fleet_list))
4
12
1
97
4
29
49
29
**args
['farm_id', 'config', 'structured_fleet_list', 'response']
None
{"Assign": 4, "Expr": 2, "Try": 1}
9
21
9
["_apply_cli_options_to_config", "config_file.get_setting", "api.list_fleets", "DeadlineOperationError", "click.echo", "_cli_object_repr", "cli_fleet.command", "click.option", "click.option"]
0
[]
The function (fleet_list) defined within the public class called public.The function start at line 29 and ends at 49. It contains 12 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has 9.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "api.list_fleets", "DeadlineOperationError", "click.echo", "_cli_object_repr", "cli_fleet.command", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
fleet_get
def fleet_get(fleet_id, queue_id, **args):"""Get the details of a fleet."""if fleet_id and queue_id:raise DeadlineOperationError("Only one of the --fleet-id and --queue-id options may be provided.")# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)if not fleet_id:queue_id = config_file.get_setting("defaults.queue_id", config=config)if not queue_id:raise click.UsageError("Missing '--fleet-id', '--queue-id', or default Queue ID configuration")deadline = api.get_boto3_client("deadline", config=config)if fleet_id:response = deadline.get_fleet(farmId=farm_id, fleetId=fleet_id)response.pop("ResponseMetadata", None)click.echo(_cli_object_repr(response))else:response = deadline.get_queue(farmId=farm_id, queueId=queue_id)queue_name = response["displayName"]response = api._list_apis._call_paginated_deadline_list_api(deadline.list_queue_fleet_associations,"queueFleetAssociations",farmId=farm_id,queueId=queue_id,)response.pop("ResponseMetadata", None)qfa_list = response["queueFleetAssociations"]click.echo(f"Showing all fleets ({len(qfa_list)} total) associated with queue: {queue_name}")for qfa in qfa_list:response = deadline.get_fleet(farmId=farm_id, fleetId=qfa["fleetId"])response.pop("ResponseMetadata", None)response["queueFleetAssociationStatus"] = qfa["status"]click.echo("")click.echo(_cli_object_repr(response))
7
38
3
239
7
58
107
58
fleet_id,queue_id,**args
['config', 'farm_id', 'deadline', 'qfa_list', 'response', 'queue_name', 'queue_id']
None
{"Assign": 11, "Expr": 8, "For": 1, "If": 4}
25
50
25
["DeadlineOperationError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "click.UsageError", "api.get_boto3_client", "deadline.get_fleet", "response.pop", "click.echo", "_cli_object_repr", "deadline.get_queue", "api._list_apis._call_paginated_deadline_list_api", "response.pop", "click.echo", "len", "deadline.get_fleet", "response.pop", "click.echo", "click.echo", "_cli_object_repr", "cli_fleet.command", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (fleet_get) defined within the public class called public.The function start at line 58 and ends at 107. It contains 38 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [58.0] and does not return any value. It declares 25.0 functions, and It has 25.0 functions called inside which are ["DeadlineOperationError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "click.UsageError", "api.get_boto3_client", "deadline.get_fleet", "response.pop", "click.echo", "_cli_object_repr", "deadline.get_queue", "api._list_apis._call_paginated_deadline_list_api", "response.pop", "click.echo", "len", "deadline.get_fleet", "response.pop", "click.echo", "click.echo", "_cli_object_repr", "cli_fleet.command", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
cli_handle_web_url
def cli_handle_web_url(ctx: click.Context,url: str,prompt_when_complete: bool,install: bool,uninstall: bool,all_users: bool,):"""Runs AWS Deadline Cloud commands sent from a web browser.Commands use the deadline:// URL scheme, with expectedformat deadline://<handle-web-url-command>?args=value&args=value.This function automatically picks the best AWS profile to usebased on the provided farm-id and queue-id.Current supported commands:deadline://download-output?farm-id=<farm-id>&queue-id=<queue-id>&job-id=<job-id>&step-id=<step-id># optional&task-id=<task-id># optional"""ctx.obj[_PROMPT_WHEN_COMPLETE] = prompt_when_complete# Determine whether we're handling a URL or installing/uninstalling the AWS Deadline Cloud URL handlerif url:if install or uninstall or all_users:raise DeadlineOperationError("The --install, --uninstall and --all-users options cannot be used with a provided URL.")split_url = urllib.parse.urlsplit(url)if split_url.scheme != DEADLINE_URL_SCHEME_NAME:raise DeadlineOperationError(f"URL scheme {split_url.scheme} is not supported. Only {DEADLINE_URL_SCHEME_NAME} is supported.")# Validate that the command is suppif split_url.netloc == "download-output":url_queries = parse_query_string(split_url.query,parameter_names=["farm-id", "queue-id", "job-id", "step-id", "task-id", "profile"],required_parameter_names=["farm-id", "queue-id", "job-id"],)# Validate the IDs# We copy the dict without the 'profile' key as that isn't a resource IDvalidate_resource_ids({k: url_queries[k] for k in url_queries.keys() - {"profile"}})farm_id = url_queries.pop("farm_id")queue_id = url_queries.pop("queue_id")job_id = url_queries.pop("job_id")step_id = url_queries.pop("step_id", None)task_id = url_queries.pop("task_id", None)# Add the standard option "profile", using the one provided by the url (set by Deadline Cloud monitor)# or choosing a best guess based on farm and queue IDsaws_profile_name = url_queries.pop("profile",config_file.get_best_profile_for_farm(farm_id, queue_id),)# Read the config, and switch the in-memory version to use the chosen AWS profileconfig = config_file.read_config()config_file.set_setting("defaults.aws_profile_name", aws_profile_name, config=config)_download_job_output(config, farm_id, queue_id, job_id, step_id, task_id)else:raise DeadlineOperationError(f"Command {split_url.netloc} is not supported through handle-web-url.",)elif install and uninstall:raise DeadlineOperationError("Only one of the --install and --uninstall options may be provided.")elif install:install_deadline_web_url_handler(all_users=all_users)elif uninstall:uninstall_deadline_web_url_handler(all_users=all_users)else:raise DeadlineOperationError("At least one of a URL, --install, or --uninstall must be provided.")_prompt_at_completion(ctx)sys.exit(0)
12
56
6
291
9
58
147
58
ctx,url,prompt_when_complete,install,uninstall,all_users
['config', 'task_id', 'farm_id', 'url_queries', 'job_id', 'aws_profile_name', 'step_id', 'split_url', 'queue_id']
None
{"Assign": 10, "Expr": 8, "If": 7}
29
90
29
["DeadlineOperationError", "urllib.parse.urlsplit", "DeadlineOperationError", "parse_query_string", "validate_resource_ids", "url_queries.keys", "url_queries.pop", "url_queries.pop", "url_queries.pop", "url_queries.pop", "url_queries.pop", "url_queries.pop", "config_file.get_best_profile_for_farm", "config_file.read_config", "config_file.set_setting", "_download_job_output", "DeadlineOperationError", "DeadlineOperationError", "install_deadline_web_url_handler", "uninstall_deadline_web_url_handler", "DeadlineOperationError", "_prompt_at_completion", "sys.exit", "main.command", "click.argument", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (cli_handle_web_url) defined within the public class called public.The function start at line 58 and ends at 147. It contains 56 lines of code and it has a cyclomatic complexity of 12. It takes 6 parameters, represented as [58.0] and does not return any value. It declares 29.0 functions, and It has 29.0 functions called inside which are ["DeadlineOperationError", "urllib.parse.urlsplit", "DeadlineOperationError", "parse_query_string", "validate_resource_ids", "url_queries.keys", "url_queries.pop", "url_queries.pop", "url_queries.pop", "url_queries.pop", "url_queries.pop", "url_queries.pop", "config_file.get_best_profile_for_farm", "config_file.read_config", "config_file.set_setting", "_download_job_output", "DeadlineOperationError", "DeadlineOperationError", "install_deadline_web_url_handler", "uninstall_deadline_web_url_handler", "DeadlineOperationError", "_prompt_at_completion", "sys.exit", "main.command", "click.argument", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
_format_timestamp
def _format_timestamp(timestamp: datetime.datetime, use_local_time: bool = False) -> str:"""Format a timestamp in ISO 8601 format with timezone information.Args:timestamp: The datetime object to formatuse_local_time: If True, convert to local time; if False, keep as UTCReturns:Formatted timestamp string in ISO 8601 format with timezone"""if use_local_time and timestamp.tzinfo is not None:# Convert to local timelocal_timestamp = timestamp.astimezone()return local_timestamp.isoformat()else:# Keep as UTC - ensure it has timezone infoif timestamp.tzinfo is None:# Assume naive datetime is UTCutc_timestamp = timestamp.replace(tzinfo=datetime.timezone.utc)else:utc_timestamp = timestampreturn utc_timestamp.isoformat()
4
10
2
75
2
62
84
62
timestamp,use_local_time
['local_timestamp', 'utc_timestamp']
str
{"Assign": 3, "Expr": 1, "If": 2, "Return": 2}
4
23
4
["timestamp.astimezone", "local_timestamp.isoformat", "timestamp.replace", "utc_timestamp.isoformat"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py.job_logs"]
The function (_format_timestamp) defined within the public class called public.The function start at line 62 and ends at 84. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [62.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside which are ["timestamp.astimezone", "local_timestamp.isoformat", "timestamp.replace", "utc_timestamp.isoformat"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py.job_logs"].
aws-deadline_deadline-cloud
public
public
0
0
cli_job
def cli_job():"""Commands to work with jobs."""
1
1
0
5
0
93
96
93
[]
None
{"Expr": 1}
1
4
1
["main.group"]
0
[]
The function (cli_job) defined within the public class called public.The function start at line 93 and ends at 96. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called inside which is ["main.group"].
aws-deadline_deadline-cloud
public
public
0
0
job_list
def job_list(page_size, item_offset, **args):"""Lists the Jobs in a queue."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)deadline = api.get_boto3_client("deadline", config=config)try:response = deadline.search_jobs(farmId=farm_id,queueIds=[queue_id],itemOffset=item_offset,pageSize=page_size,sortExpressions=[{"fieldSort": {"name": "CREATED_AT", "sortOrder": "DESCENDING"}}],)except ClientError as exc:raise DeadlineOperationError(f"Failed to get Jobs from Deadline:\n{exc}") from exctotal_results = response["totalResults"]# Select which fields to print and in which ordername_field = "displayName"if len(response["jobs"]) and "name" in response["jobs"][0]:name_field = "name"structured_job_list = [{field: job.get(field, "")for field in [name_field,"jobId","taskRunStatus","startedAt","endedAt","createdBy","createdAt",]}for job in response["jobs"]]click.echo(f"Displaying {len(structured_job_list)} of {total_results} Jobs starting at {item_offset}")click.echo()click.echo(_cli_object_repr(structured_job_list))
6
39
3
214
8
106
154
106
page_size,item_offset,**args
['config', 'name_field', 'farm_id', 'deadline', 'structured_job_list', 'response', 'total_results', 'queue_id']
None
{"Assign": 9, "Expr": 4, "If": 1, "Try": 1}
19
49
19
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.search_jobs", "DeadlineOperationError", "len", "job.get", "click.echo", "len", "click.echo", "click.echo", "_cli_object_repr", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (job_list) defined within the public class called public.The function start at line 106 and ends at 154. It contains 39 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [106.0] and does not return any value. It declares 19.0 functions, and It has 19.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.search_jobs", "DeadlineOperationError", "len", "job.get", "click.echo", "len", "click.echo", "click.echo", "_cli_object_repr", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
job_get
def job_get(**args):"""Get the details of a job."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id", "job_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)deadline = api.get_boto3_client("deadline", config=config)response = deadline.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)response.pop("ResponseMetadata", None)click.echo(_cli_object_repr(response))
1
11
1
107
6
163
180
163
**args
['config', 'farm_id', 'deadline', 'job_id', 'response', 'queue_id']
None
{"Assign": 6, "Expr": 3}
14
18
14
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.get_job", "response.pop", "click.echo", "_cli_object_repr", "cli_job.command", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (job_get) defined within the public class called public.The function start at line 163 and ends at 180. It contains 11 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 14.0 functions, and It has 14.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.get_job", "response.pop", "click.echo", "_cli_object_repr", "cli_job.command", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
job_cancel
def job_cancel(mark_as: str, yes: bool, **args):"""Cancel job from running."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id", "job_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)mark_as = mark_as.upper()deadline = api.get_boto3_client("deadline", config=config)# Print a summary of the job to canceljob = deadline.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)# Remove the zero-count status countsjob["taskRunStatusCounts"] = {name: count for name, count in job["taskRunStatusCounts"].items() if count != 0}# Filter the fields to a summaryfiltered_job = {field: job.get(field, "")for field in ["name","jobId","taskRunStatus","taskRunStatusCounts","startedAt","endedAt","createdBy","createdAt",]}click.echo(_cli_object_repr(filtered_job))# Ask for confirmation about canceling this job.if not (yes or config_file.str2bool(config_file.get_setting("settings.auto_accept", config=config))):if mark_as == "CANCELED":cancel_message = "Are you sure you want to cancel this job?"else:cancel_message = (f"Are you sure you want to cancel this job and mark its taskRunStatus as {mark_as}?")# We explicitly require a yes/no response, as this is an operation that will interrupt the work in progress# on their job.if not click.confirm(cancel_message,default=None,):click.echo("Job not canceled.")sys.exit(1)if mark_as == "CANCELED":click.echo("Canceling job...")else:click.echo(f"Canceling job and marking as {mark_as}...")deadline.update_job(farmId=farm_id, queueId=queue_id, jobId=job_id, targetTaskRunStatus=mark_as)
9
47
3
280
9
200
262
200
mark_as,yes,**args
['config', 'cancel_message', 'farm_id', 'filtered_job', 'deadline', 'mark_as', 'job_id', 'job', 'queue_id']
None
{"Assign": 11, "Expr": 7, "If": 4}
27
63
27
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "mark_as.upper", "api.get_boto3_client", "deadline.get_job", "items", "job.get", "click.echo", "_cli_object_repr", "config_file.str2bool", "config_file.get_setting", "click.confirm", "click.echo", "sys.exit", "click.echo", "click.echo", "deadline.update_job", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"]
0
[]
The function (job_cancel) defined within the public class called public.The function start at line 200 and ends at 262. It contains 47 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [200.0] and does not return any value. It declares 27.0 functions, and It has 27.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "mark_as.upper", "api.get_boto3_client", "deadline.get_job", "items", "job.get", "click.echo", "_cli_object_repr", "config_file.str2bool", "config_file.get_setting", "click.confirm", "click.echo", "sys.exit", "click.echo", "click.echo", "deadline.update_job", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
job_requeue_tasks
def job_requeue_tasks(run_status: Optional[list[str]], **args):"""Requeue tasks of a job. By default, requeues all FAILED, CANCELED, and SUSPENDED tasks.Use the --run-status option to requeue tasks of different status."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id", "job_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)if not run_status:run_status_set = {"SUSPENDED", "CANCELED", "FAILED"}else:run_status_set = {status.upper() for status in run_status}session = api.get_boto3_session(config=config)deadline_client = api.get_boto3_client("deadline", config=config)# Create a separate API client for the update_task calls, using the "adaptive" retry strategy.# This strategy is better suited to repeatedly calling the API for a longer duration, because it# retains backoff data across calls instead of starting fresh each time.requeues_client_config = get_default_client_config(retries=dict(mode="adaptive", total_max_attempts=5))deadline_client_for_requeues = session.client("deadline", config=requeues_client_config)# Print a summary of the job's task run statusesjob = deadline_client.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)click.echo(f"Job: {job['name']} ({job['jobId']})")# Remove the zero-count status counts for a shorter summarytask_run_status_counts = {name.upper(): count for name, count in job["taskRunStatusCounts"].items() if count != 0}click.echo(_cli_object_repr({"taskRunStatusCounts": task_run_status_counts}))click.echo(f"Requeuing all tasks with run status among: {', '.join(sorted(run_status_set))}")total_task_count_to_requeue = sum(count for name, count in task_run_status_counts.items() if name in run_status_set)summary_task_count_by_status = ", ".join(f"{count} {name} tasks"for name, count in task_run_status_counts.items()if name in run_status_set and count != 0)summary_tasks_message = f"{total_task_count_to_requeue} total tasks"if total_task_count_to_requeue == 0:click.echo("No tasks to requeue.")return# Ask for confirmation about requeuing the selected tasksif config_file.str2bool(config_file.get_setting("settings.auto_accept", config=config)):click.echo(f"Estimated {summary_tasks_message} ({summary_task_count_by_status}) to requeue.")else:click.echo(f"This action will requeue an estimated {summary_tasks_message} ({summary_task_count_by_status})")if not click.confirm("Are you sure you want to requeue these tasks?",default=None,):click.echo("No tasks were requeued.")sys.exit(1)click.echo("Requeuing tasks...")total_count_requeued = 0# Use a paginator to get all the stepspaginator = deadline_client.get_paginator("list_steps")steps = []for page in paginator.paginate(farmId=farm_id, queueId=queue_id, jobId=job_id):steps.extend(page["steps"])# For each step, requeue all the tasks matching the run statusesfor step in steps:click.echo(f"\nStep: {step['name']} ({step['stepId']})")step_task_count_to_requeue = sum(count for name, count in step["taskRunStatusCounts"].items() if name in run_status_set)summary_task_count_by_status = ", ".join(f"{count} {name} tasks"for name, count in step["taskRunStatusCounts"].items()if name in run_status_set and count != 0)summary_tasks_message = f"{step_task_count_to_requeue} total tasks"if step_task_count_to_requeue == 0:click.echo("Step has no tasks to requeue.")continueelse:click.echo(f"Requeuing an estimated {summary_tasks_message} ({summary_task_count_by_status})...")paginator = deadline_client.get_paginator("list_tasks")for page in paginator.paginate(farmId=farm_id, queueId=queue_id, jobId=job_id, stepId=step["stepId"]):for task in page["tasks"]:if task["runStatus"].upper() in run_status_set:parameters = task.get("parameters", {})if parameters:task_summary = (",".join(f"{param}={list(parameters[param].values())[0]}"for param in parameters)+ f" ({task['taskId']})")else:task_summary = task["taskId"]click.echo(f"{task['runStatus']} {task_summary}")# Requeue means to set the target run status to PENDING. If a task has no dependencies,# it will switch to READY immediately.deadline_client_for_requeues.update_task(farmId=farm_id,queueId=queue_id,jobId=job_id,stepId=step["stepId"],taskId=task["taskId"],targetRunStatus="PENDING",)total_count_requeued += 1click.echo(f"\nRequeued a total of {total_count_requeued} tasks.")
26
102
2
631
20
284
414
284
run_status,**args
['paginator', 'config', 'step_task_count_to_requeue', 'total_task_count_to_requeue', 'summary_task_count_by_status', 'summary_tasks_message', 'farm_id', 'run_status_set', 'deadline_client', 'task_run_status_counts', 'steps', 'total_count_requeued', 'requeues_client_config', 'task_summary', 'parameters', 'job_id', 'deadline_client_for_requeues', 'session', 'job', 'queue_id']
None
{"Assign": 25, "AugAssign": 1, "Expr": 17, "For": 4, "If": 7, "Return": 1}
60
131
60
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "status.upper", "api.get_boto3_session", "api.get_boto3_client", "get_default_client_config", "dict", "session.client", "deadline_client.get_job", "click.echo", "name.upper", "items", "click.echo", "_cli_object_repr", "click.echo", "join", "sorted", "sum", "task_run_status_counts.items", "join", "task_run_status_counts.items", "click.echo", "config_file.str2bool", "config_file.get_setting", "click.echo", "click.echo", "click.confirm", "click.echo", "sys.exit", "click.echo", "deadline_client.get_paginator", "paginator.paginate", "steps.extend", "click.echo", "sum", "items", "join", "items", "click.echo", "click.echo", "deadline_client.get_paginator", "paginator.paginate", "upper", "task.get", "join", "list", "values", "click.echo", "deadline_client_for_requeues.update_task", "click.echo", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"]
0
[]
The function (job_requeue_tasks) defined within the public class called public.The function start at line 284 and ends at 414. It contains 102 lines of code and it has a cyclomatic complexity of 26. It takes 2 parameters, represented as [284.0] and does not return any value. It declares 60.0 functions, and It has 60.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "status.upper", "api.get_boto3_session", "api.get_boto3_client", "get_default_client_config", "dict", "session.client", "deadline_client.get_job", "click.echo", "name.upper", "items", "click.echo", "_cli_object_repr", "click.echo", "join", "sorted", "sum", "task_run_status_counts.items", "join", "task_run_status_counts.items", "click.echo", "config_file.str2bool", "config_file.get_setting", "click.echo", "click.echo", "click.confirm", "click.echo", "sys.exit", "click.echo", "deadline_client.get_paginator", "paginator.paginate", "steps.extend", "click.echo", "sum", "items", "join", "items", "click.echo", "click.echo", "deadline_client.get_paginator", "paginator.paginate", "upper", "task.get", "join", "list", "values", "click.echo", "deadline_client_for_requeues.update_task", "click.echo", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
_download_job_output._check_and_warn_long_output_paths
def _check_and_warn_long_output_paths(output_paths_by_root: dict[str, list[str]],) -> None:if sys.platform == "win32" and not _is_windows_long_path_registry_enabled():for root, paths in output_paths_by_root.items():for output_path in paths:if len(root + output_path) >= WINDOWS_MAX_PATH_LENGTH:click.secho(_get_long_path_found_message(is_json_format),fg="yellow",)
6
11
1
70
0
482
492
482
null
[]
None
null
0
0
0
null
0
null
The function (_download_job_output._check_and_warn_long_output_paths) defined within the public class called public.The function start at line 482 and ends at 492. It contains 11 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
_download_job_output._download_job_output
def _download_job_output(file_conflict_resolution: Optional[FileConflictResolution] = FileConflictResolution.CREATE_COPY,on_downloading_files: Optional[Callable[[ProgressReportMetadata], bool]] = None,) -> DownloadSummaryStatistics:return job_output_downloader.download_job_output(file_conflict_resolution=file_conflict_resolution,on_downloading_files=on_downloading_files,)
1
10
3
47
0
626
635
626
null
[]
None
null
0
0
0
null
0
null
The function (_download_job_output._download_job_output) defined within the public class called public.The function start at line 626 and ends at 635. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [626.0] and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
_download_job_output._update_download_progress
def _update_download_progress(download_metadata: ProgressReportMetadata,) -> bool:new_progress = int(download_metadata.progress) - download_progress.posif new_progress > 0:download_progress.update(new_progress)return sigint_handler.continue_operation
2
7
1
37
0
642
648
642
null
[]
None
null
0
0
0
null
0
null
The function (_download_job_output._update_download_progress) defined within the public class called public.The function start at line 642 and ends at 648. 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..
aws-deadline_deadline-cloud
public
public
0
0
_download_job_output._update_download_progress
def _update_download_progress(download_metadata: ProgressReportMetadata,) -> bool:click.echo(_get_json_line(JSON_MSG_TYPE_PROGRESS, str(int(download_metadata.progress))))# TODO: enable download cancellation for JSON formatreturn True
1
7
1
31
0
656
663
656
null
[]
None
null
0
0
0
null
0
null
The function (_download_job_output._update_download_progress) defined within the public class called public.The function start at line 656 and ends at 663. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
_download_job_output
def _download_job_output(config: Optional[ConfigParser],farm_id: str,queue_id: str,job_id: str,step_id: Optional[str],task_id: Optional[str],is_json_format: bool = False,):"""Starts the download of job output and handles the progress reporting callback."""deadline = api.get_boto3_client("deadline", config=config)auto_accept = config_file.str2bool(config_file.get_setting("settings.auto_accept", config=config))conflict_resolution = config_file.get_setting("settings.conflict_resolution", config=config)job = deadline.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)step = {}task = {}if step_id:step = deadline.get_step(farmId=farm_id, queueId=queue_id, jobId=job_id, stepId=step_id)if task_id:task = deadline.get_task(farmId=farm_id,queueId=queue_id,jobId=job_id,stepId=step_id,taskId=task_id,)click.echo(_get_start_message(job["name"], step.get("name"), task.get("parameters"), is_json_format))queue = deadline.get_queue(farmId=farm_id, queueId=queue_id)queue_role_session = api.get_queue_user_boto3_session(deadline=deadline,config=config,farm_id=farm_id,queue_id=queue_id,queue_display_name=queue["displayName"],)# Get a dictionary mapping rootPath to rootPathFormat (OS) from job's manifestsroot_path_format_mapping: dict[str, str] = {}job_attachments = job.get("attachments", None)if job_attachments:job_attachments_manifests = job_attachments["manifests"]for manifest in job_attachments_manifests:root_path_format_mapping[manifest["rootPath"]] = manifest["rootPathFormat"]job_output_downloader = OutputDownloader(s3_settings=JobAttachmentS3Settings(**queue["jobAttachmentSettings"]),farm_id=farm_id,queue_id=queue_id,job_id=job_id,step_id=step_id,task_id=task_id,session=queue_role_session,)def _check_and_warn_long_output_paths(output_paths_by_root: dict[str, list[str]],) -> None:if sys.platform == "win32" and not _is_windows_long_path_registry_enabled():for root, paths in output_paths_by_root.items():for output_path in paths:if len(root + output_path) >= WINDOWS_MAX_PATH_LENGTH:click.secho(_get_long_path_found_message(is_json_format),fg="yellow",)output_paths_by_root = job_output_downloader.get_output_paths_by_root()# If no output paths were found, log a message and exit.if output_paths_by_root == {}:click.echo(_get_no_output_message(is_json_format))return_check_and_warn_long_output_paths(output_paths_by_root)# Check if the asset roots came from different OS. If so, prompt users to# select alternative root paths to download to, (regardless of the auto-accept.)asset_roots = list(output_paths_by_root.keys())for asset_root in asset_roots:root_path_format = root_path_format_mapping.get(asset_root, "")if root_path_format == "":# There must be a corresponding root path format for each root path, by design.raise DeadlineOperationError(f"No root path format found for {asset_root}.")if PathFormat.get_host_path_format_string() != root_path_format:click.echo(_get_mismatch_os_root_warning(asset_root, root_path_format, is_json_format))if not is_json_format:new_root = click.prompt("> Please enter a new root path",type=click.Path(exists=False),)else:json_string = click.prompt("", prompt_suffix="", type=str)new_root = _get_value_from_json_line(json_string, JSON_MSG_TYPE_PATHCONFIRM, expected_size=1)[0]_assert_valid_path(new_root)job_output_downloader.set_root_path(asset_root, os.path.expanduser(new_root))output_paths_by_root = job_output_downloader.get_output_paths_by_root()_check_and_warn_long_output_paths(output_paths_by_root)# Prompt users to confirm local root paths where they will download outputs to,# and allow users to select different location to download files to if they want.# (If auto-accept is enabled, automatically download to the default root paths.)if not auto_accept:if not is_json_format:user_choice = ""while user_choice != ("y" or "n"):click.echo(_get_summary_of_files_to_download_message(output_paths_by_root, is_json_format))asset_roots = list(output_paths_by_root.keys())click.echo(_get_roots_list_message(asset_roots, is_json_format))user_choice = click.prompt("> Please enter the index of root directory to edit, y to proceed without changes, or n to cancel the download",type=click.Choice([*[str(num) for num in list(range(0, len(asset_roots)))],"y","n",]),default="y",)if user_choice == "n":click.echo("Output download canceled.")returnelif user_choice != "y":# User selected an index to modify the root directory.index_to_change = int(user_choice)new_root = click.prompt("> Please enter the new root directory path, or press Enter to keep it unchanged",type=click.Path(exists=False),default=asset_roots[index_to_change],)job_output_downloader.set_root_path(asset_roots[index_to_change], str(Path(new_root)))output_paths_by_root = job_output_downloader.get_output_paths_by_root()_check_and_warn_long_output_paths(output_paths_by_root)else:click.echo(_get_summary_of_files_to_download_message(output_paths_by_root, is_json_format))asset_roots = list(output_paths_by_root.keys())click.echo(_get_roots_list_message(asset_roots, is_json_format))json_string = click.prompt("", prompt_suffix="", type=str)confirmed_asset_roots = _get_value_from_json_line(json_string, JSON_MSG_TYPE_PATHCONFIRM, expected_size=len(asset_roots))for index, confirmed_root in enumerate(confirmed_asset_roots):_assert_valid_path(confirmed_root)job_output_downloader.set_root_path(asset_roots[index], str(Path(confirmed_root)))output_paths_by_root = job_output_downloader.get_output_paths_by_root()_check_and_warn_long_output_paths(output_paths_by_root)if not is_json_format:# Create and print a summary of all the paths to downloadall_output_paths: set[str] = set()for asset_root, output_paths in output_paths_by_root.items():all_output_paths.update(os.path.normpath(os.path.join(asset_root, path)) for path in output_paths)click.echo("\nSummary of file paths to download:")click.echo(textwrap.indent(summarize_path_list(all_output_paths), ""))# If the conflict resolution option was not specified, auto-accept is false, and# if there are any conflicting files in local, prompt users to select a resolution method.# (skip, overwrite, or make a copy.)if conflict_resolution != FileConflictResolution.NOT_SELECTED.name:file_conflict_resolution = FileConflictResolution[conflict_resolution]elif auto_accept:file_conflict_resolution = FileConflictResolution.CREATE_COPYelse:file_conflict_resolution = FileConflictResolution.CREATE_COPYconflicting_filenames = _get_conflicting_filenames(output_paths_by_root)if conflicting_filenames:click.echo(_get_conflict_resolution_selection_message(conflicting_filenames))user_choice = click.prompt("> Please enter your choice (1, 2, 3, or n to cancel the download)",type=click.Choice(["1", "2", "3", "n"]),default="3",)if user_choice == "n":click.echo("Output download canceled.")returnelse:resolution_choice_int = int(user_choice)file_conflict_resolution = FileConflictResolution(resolution_choice_int)# TODO: remove logging level setting when the max number connections for boto3 client# in Job Attachments library can be increased (currently using default number, 10, which# makes it keep logging urllib3 warning messages when downloading large files)with _modified_logging_level(logging.getLogger("urllib3"), logging.ERROR):@api.record_success_fail_telemetry_event(metric_name="download_job_output")def _download_job_output(file_conflict_resolution: Optional[FileConflictResolution] = FileConflictResolution.CREATE_COPY,on_downloading_files: Optional[Callable[[ProgressReportMetadata], bool]] = None,) -> DownloadSummaryStatistics:return job_output_downloader.download_job_output(file_conflict_resolution=file_conflict_resolution,on_downloading_files=on_downloading_files,)if not is_json_format:# Note: click doesn't export the return type of progressbar(), so we suppress mypy warnings for# not annotating the type of download_progress.with click.progressbar(length=100, label="Downloading Outputs") as download_progress:# type: ignore[var-annotated]def _update_download_progress(download_metadata: ProgressReportMetadata,) -> bool:new_progress = int(download_metadata.progress) - download_progress.posif new_progress > 0:download_progress.update(new_progress)return sigint_handler.continue_operationdownload_summary: DownloadSummaryStatistics = _download_job_output(# type: ignorefile_conflict_resolution=file_conflict_resolution,on_downloading_files=_update_download_progress,)else:def _update_download_progress(download_metadata: ProgressReportMetadata,) -> bool:click.echo(_get_json_line(JSON_MSG_TYPE_PROGRESS, str(int(download_metadata.progress))))# TODO: enable download cancellation for JSON formatreturn Truedownload_summary = _download_job_output(# type: ignorefile_conflict_resolution=file_conflict_resolution,on_downloading_files=_update_download_progress,)click.echo(_get_download_summary_message(download_summary, is_json_format))click.echo()
26
176
7
1,059
24
417
671
417
config,farm_id,queue_id,job_id,step_id,task_id,is_json_format
['new_root', 'output_paths_by_root', 'new_progress', 'job_attachments_manifests', 'root_path_format', 'conflicting_filenames', 'user_choice', 'download_summary', 'job_attachments', 'step', 'conflict_resolution', 'queue', 'job_output_downloader', 'deadline', 'auto_accept', 'confirmed_asset_roots', 'file_conflict_resolution', 'task', 'json_string', 'resolution_choice_int', 'index_to_change', 'queue_role_session', 'job', 'asset_roots']
Returns
{"AnnAssign": 3, "Assign": 40, "Expr": 28, "For": 6, "If": 20, "Return": 6, "While": 1, "With": 2}
111
255
111
["api.get_boto3_client", "config_file.str2bool", "config_file.get_setting", "config_file.get_setting", "deadline.get_job", "deadline.get_step", "deadline.get_task", "click.echo", "_get_start_message", "step.get", "task.get", "deadline.get_queue", "api.get_queue_user_boto3_session", "job.get", "OutputDownloader", "JobAttachmentS3Settings", "_is_windows_long_path_registry_enabled", "output_paths_by_root.items", "len", "click.secho", "_get_long_path_found_message", "job_output_downloader.get_output_paths_by_root", "click.echo", "_get_no_output_message", "_check_and_warn_long_output_paths", "list", "output_paths_by_root.keys", "root_path_format_mapping.get", "DeadlineOperationError", "PathFormat.get_host_path_format_string", "click.echo", "_get_mismatch_os_root_warning", "click.prompt", "click.Path", "click.prompt", "_get_value_from_json_line", "_assert_valid_path", "job_output_downloader.set_root_path", "os.path.expanduser", "job_output_downloader.get_output_paths_by_root", "_check_and_warn_long_output_paths", "click.echo", "_get_summary_of_files_to_download_message", "list", "output_paths_by_root.keys", "click.echo", "_get_roots_list_message", "click.prompt", "click.Choice", "str", "list", "range", "len", "click.echo", "int", "click.prompt", "click.Path", "job_output_downloader.set_root_path", "str", "Path", "job_output_downloader.get_output_paths_by_root", "_check_and_warn_long_output_paths", "click.echo", "_get_summary_of_files_to_download_message", "list", "output_paths_by_root.keys", "click.echo", "_get_roots_list_message", "click.prompt", "_get_value_from_json_line", "len", "enumerate", "_assert_valid_path", "job_output_downloader.set_root_path", "str", "Path", "job_output_downloader.get_output_paths_by_root", "_check_and_warn_long_output_paths", "set", "output_paths_by_root.items", "all_output_paths.update", "os.path.normpath", "os.path.join", "click.echo", "click.echo", "textwrap.indent", "summarize_path_list", "_get_conflicting_filenames", "click.echo", "_get_conflict_resolution_selection_message", "click.prompt", "click.Choice", "click.echo", "int", "FileConflictResolution", "_modified_logging_level", "logging.getLogger", "job_output_downloader.download_job_output", "api.record_success_fail_telemetry_event", "click.progressbar", "int", "download_progress.update", "_download_job_output", "click.echo", "_get_json_line", "str", "int", "_download_job_output", "click.echo", "_get_download_summary_message", "click.echo"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline._mcp.tools.job_py.download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.handle_web_url_command_py.cli_handle_web_url", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py.job_download_output"]
The function (_download_job_output) defined within the public class called public.The function start at line 417 and ends at 671. It contains 176 lines of code and it has a cyclomatic complexity of 26. It takes 7 parameters, represented as [417.0], and this function return a value. It declares 111.0 functions, It has 111.0 functions called inside which are ["api.get_boto3_client", "config_file.str2bool", "config_file.get_setting", "config_file.get_setting", "deadline.get_job", "deadline.get_step", "deadline.get_task", "click.echo", "_get_start_message", "step.get", "task.get", "deadline.get_queue", "api.get_queue_user_boto3_session", "job.get", "OutputDownloader", "JobAttachmentS3Settings", "_is_windows_long_path_registry_enabled", "output_paths_by_root.items", "len", "click.secho", "_get_long_path_found_message", "job_output_downloader.get_output_paths_by_root", "click.echo", "_get_no_output_message", "_check_and_warn_long_output_paths", "list", "output_paths_by_root.keys", "root_path_format_mapping.get", "DeadlineOperationError", "PathFormat.get_host_path_format_string", "click.echo", "_get_mismatch_os_root_warning", "click.prompt", "click.Path", "click.prompt", "_get_value_from_json_line", "_assert_valid_path", "job_output_downloader.set_root_path", "os.path.expanduser", "job_output_downloader.get_output_paths_by_root", "_check_and_warn_long_output_paths", "click.echo", "_get_summary_of_files_to_download_message", "list", "output_paths_by_root.keys", "click.echo", "_get_roots_list_message", "click.prompt", "click.Choice", "str", "list", "range", "len", "click.echo", "int", "click.prompt", "click.Path", "job_output_downloader.set_root_path", "str", "Path", "job_output_downloader.get_output_paths_by_root", "_check_and_warn_long_output_paths", "click.echo", "_get_summary_of_files_to_download_message", "list", "output_paths_by_root.keys", "click.echo", "_get_roots_list_message", "click.prompt", "_get_value_from_json_line", "len", "enumerate", "_assert_valid_path", "job_output_downloader.set_root_path", "str", "Path", "job_output_downloader.get_output_paths_by_root", "_check_and_warn_long_output_paths", "set", "output_paths_by_root.items", "all_output_paths.update", "os.path.normpath", "os.path.join", "click.echo", "click.echo", "textwrap.indent", "summarize_path_list", "_get_conflicting_filenames", "click.echo", "_get_conflict_resolution_selection_message", "click.prompt", "click.Choice", "click.echo", "int", "FileConflictResolution", "_modified_logging_level", "logging.getLogger", "job_output_downloader.download_job_output", "api.record_success_fail_telemetry_event", "click.progressbar", "int", "download_progress.update", "_download_job_output", "click.echo", "_get_json_line", "str", "int", "_download_job_output", "click.echo", "_get_download_summary_message", "click.echo"], It has 4.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline._mcp.tools.job_py.download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.handle_web_url_command_py.cli_handle_web_url", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py.job_download_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_start_message
def _get_start_message(job_name: str,step_name: Optional[str],task_parameters: Optional[dict],is_json_format: bool,) -> str:if is_json_format:return _get_json_line(JSON_MSG_TYPE_TITLE, job_name)else:if step_name is None:return f"Downloading output from Job {job_name!r}"elif task_parameters is None:return f"Downloading output from Job {job_name!r} Step {step_name!r}"else:task_parameters_summary = "{}"if task_parameters:task_parameters_summary = ("{"+ ",".join(f"{key}={list(value.values())[0]}" for key, value in task_parameters.items())+ "}")return f"Downloading output from Job {job_name!r} Step {step_name!r} Task {task_parameters_summary}"
6
24
4
92
1
674
697
674
job_name,step_name,task_parameters,is_json_format
['task_parameters_summary']
str
{"Assign": 2, "If": 4, "Return": 4}
5
24
5
["_get_json_line", "join", "list", "value.values", "task_parameters.items"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_start_message) defined within the public class called public.The function start at line 674 and ends at 697. It contains 24 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [674.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions called inside which are ["_get_json_line", "join", "list", "value.values", "task_parameters.items"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_no_output_message
def _get_no_output_message(is_json_format: bool) -> str:msg = ("There are no output files available for download at this moment. Please verify that"" the Job/Step/Task you are trying to download output from has completed successfully.")if is_json_format:return _get_json_line(JSON_MSG_TYPE_SUMMARY, msg)else:return msg
2
9
1
29
1
700
708
700
is_json_format
['msg']
str
{"Assign": 1, "If": 1, "Return": 2}
1
9
1
["_get_json_line"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_no_output_message) defined within the public class called public.The function start at line 700 and ends at 708. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside which is ["_get_json_line"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_mismatch_os_root_warning
def _get_mismatch_os_root_warning(root: str, root_path_format: str, is_json_format: bool) -> str:if is_json_format:return _get_json_line(JSON_MSG_TYPE_PATH, [root])else:path_format_capitalized_first_letter = root_path_format[0].upper() + root_path_format[1:]return ("This root path format does not match the operating system you're using. ""Where would you like to save the files?\n"f"The location was {root}, on {path_format_capitalized_first_letter}.")
2
10
3
54
1
711
720
711
root,root_path_format,is_json_format
['path_format_capitalized_first_letter']
str
{"Assign": 1, "If": 1, "Return": 2}
2
10
2
["_get_json_line", "upper"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_mismatch_os_root_warning) defined within the public class called public.The function start at line 711 and ends at 720. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [711.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside which are ["_get_json_line", "upper"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_summary_of_files_to_download_message
def _get_summary_of_files_to_download_message(output_paths_by_root: dict[str, list[str]], is_json_format: bool) -> str:# Print some information about what we will downloadif is_json_format:return _get_json_line(JSON_MSG_TYPE_PRESUMMARY, output_paths_by_root)else:paths_message_joined = "" + "\n".join(f"{os.path.commonpath([os.path.join(directory, p) for p in output_paths])} ({len(output_paths)} file{'s' if len(output_paths) > 1 else ''})"for directory, output_paths in output_paths_by_root.items())return f"\nSummary of files to download:\n{paths_message_joined}\n"
3
11
2
57
1
723
734
723
output_paths_by_root,is_json_format
['paths_message_joined']
str
{"Assign": 1, "If": 1, "Return": 2}
7
12
7
["_get_json_line", "join", "os.path.commonpath", "os.path.join", "len", "len", "output_paths_by_root.items"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.test_get_summary_of_files_to_download_message_posix", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.test_get_summary_of_files_to_download_message_windows"]
The function (_get_summary_of_files_to_download_message) defined within the public class called public.The function start at line 723 and ends at 734. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [723.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions called inside which are ["_get_json_line", "join", "os.path.commonpath", "os.path.join", "len", "len", "output_paths_by_root.items"], It has 3.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.test_get_summary_of_files_to_download_message_posix", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.test_get_summary_of_files_to_download_message_windows"].
aws-deadline_deadline-cloud
public
public
0
0
_get_roots_list_message
def _get_roots_list_message(asset_roots: list[str], is_json_format: bool) -> str:if is_json_format:return _get_json_line(JSON_MSG_TYPE_PATH, asset_roots)else:asset_roots_str = "\n".join([f"[{index}] {root}" for index, root in enumerate(asset_roots)])return (f"You are about to download files which may come from multiple root directories. Here are a list of the current root directories:\n"f"{asset_roots_str}")
3
9
2
55
1
737
745
737
asset_roots,is_json_format
['asset_roots_str']
str
{"Assign": 1, "If": 1, "Return": 2}
3
9
3
["_get_json_line", "join", "enumerate"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_roots_list_message) defined within the public class called public.The function start at line 737 and ends at 745. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [737.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions called inside which are ["_get_json_line", "join", "enumerate"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_conflict_resolution_selection_message
def _get_conflict_resolution_selection_message(conflicting_filenames: list[str]) -> str:conflicting_filenames_str = "\n".join(conflicting_filenames)return (f"The following files already exist in your local directory:\n{conflicting_filenames_str}\n"f"You have three options to choose from:\n"f"[1] Skip: Do not download these files\n"f"[2] Overwrite: Download these files and overwrite existing files\n"f"[3] Create a copy: Download the file with a new name, appending '(1)' to the end")
1
9
1
33
1
748
756
748
conflicting_filenames
['conflicting_filenames_str']
str
{"Assign": 1, "Return": 1}
1
9
1
["join"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_conflict_resolution_selection_message) defined within the public class called public.The function start at line 748 and ends at 756. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside which is ["join"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_download_summary_message
def _get_download_summary_message(download_summary: DownloadSummaryStatistics, is_json_format: bool) -> str:if is_json_format:return _get_json_line(JSON_MSG_TYPE_SUMMARY,f"Downloaded {download_summary.processed_files} files",extra_properties={"fileCount": download_summary.processed_files},)else:paths_joined = "\n".join(f"{directory} ({count} file{'s' if count > 1 else ''})"for directory, count in download_summary.file_counts_by_root_directory.items())return ("Download Summary:\n"f"Downloaded {download_summary.processed_files} files totaling"f" {human_readable_file_size(download_summary.processed_bytes)}.\n"f"Total download time of {round(download_summary.total_time, ndigits=5)} seconds"f" at {human_readable_file_size(int(download_summary.transfer_rate))}/s.\n"f"Download locations (total file counts):\n{paths_joined}")
3
22
2
72
1
759
780
759
download_summary,is_json_format
['paths_joined']
str
{"Assign": 1, "If": 1, "Return": 2}
7
22
7
["_get_json_line", "join", "download_summary.file_counts_by_root_directory.items", "human_readable_file_size", "round", "human_readable_file_size", "int"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_download_summary_message_json_with_file_count", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_download_summary_message_json_zero_files", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_download_summary_message_non_json_unchanged"]
The function (_get_download_summary_message) defined within the public class called public.The function start at line 759 and ends at 780. It contains 22 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [759.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions called inside which are ["_get_json_line", "join", "download_summary.file_counts_by_root_directory.items", "human_readable_file_size", "round", "human_readable_file_size", "int"], It has 4.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_download_summary_message_json_with_file_count", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_download_summary_message_json_zero_files", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_download_summary_message_non_json_unchanged"].
aws-deadline_deadline-cloud
public
public
0
0
_get_long_path_found_message
def _get_long_path_found_message(is_json_format: bool) -> str:message = """WARNING: Found downloaded file paths that exceed Windows path length limit. This may cause unexpected issues.For details and a fix using the registry, see: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation"""if is_json_format:return _get_json_line(JSON_MSG_TYPE_WARNING, message)else:return message
2
9
1
26
1
783
792
783
is_json_format
['message']
str
{"Assign": 1, "If": 1, "Return": 2}
1
10
1
["_get_json_line"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_long_path_found_message) defined within the public class called public.The function start at line 783 and ends at 792. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside which is ["_get_json_line"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_conflicting_filenames
def _get_conflicting_filenames(filenames_by_root: dict[str, list[str]]) -> list[str]:conflicting_filenames: list[str] = []for root, filenames in filenames_by_root.items():for filename in filenames:abs_path = Path(root).joinpath(filename).resolve()if abs_path.is_file():conflicting_filenames.append(str(abs_path))return conflicting_filenames
4
8
1
78
1
795
804
795
filenames_by_root
['abs_path']
list[str]
{"AnnAssign": 1, "Assign": 1, "Expr": 1, "For": 2, "If": 1, "Return": 1}
7
10
7
["filenames_by_root.items", "resolve", "joinpath", "Path", "abs_path.is_file", "conflicting_filenames.append", "str"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_conflicting_filenames) defined within the public class called public.The function start at line 795 and ends at 804. It contains 8 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 7.0 functions, It has 7.0 functions called inside which are ["filenames_by_root.items", "resolve", "joinpath", "Path", "abs_path.is_file", "conflicting_filenames.append", "str"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_get_json_line
def _get_json_line(messageType: str,value: Union[str, list[str], dict[str, Any]],extra_properties: Optional[dict[str, Any]] = None,) -> str:json_obj = {"messageType": messageType, "value": value}if extra_properties:json_obj.update(extra_properties)return json.dumps(json_obj, ensure_ascii=True)
2
9
3
74
1
807
815
807
messageType,value,extra_properties
['json_obj']
str
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
2
9
2
["json_obj.update", "json.dumps"]
13
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_download_summary_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_long_path_found_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_mismatch_os_root_warning", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_no_output_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_roots_list_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_start_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_summary_of_files_to_download_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py.job_download_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_basic", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_with_kwargs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_with_list_value", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_with_none_extra_properties"]
The function (_get_json_line) defined within the public class called public.The function start at line 807 and ends at 815. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [807.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside which are ["json_obj.update", "json.dumps"], It has 13.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_download_summary_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_long_path_found_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_mismatch_os_root_warning", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_no_output_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_roots_list_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_start_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._get_summary_of_files_to_download_message", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py.job_download_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_basic", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_with_kwargs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_with_list_value", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_job_py.TestJsonLineHelpers.test_get_json_line_with_none_extra_properties"].
aws-deadline_deadline-cloud
public
public
0
0
_get_value_from_json_line
def _get_value_from_json_line(json_line: str, message_type: str, expected_size: Optional[int] = None) -> Union[str, list[str]]:try:parsed_json = json.loads(json_line)if parsed_json["messageType"] != message_type:raise ValueError(f"Expected message type '{message_type}' but received '{parsed_json['messageType']}'")if expected_size and len(parsed_json["value"]) != expected_size:raise ValueError(f"Expected {expected_size} item{'' if expected_size == 1 else 's'} in value "f"but received {len(parsed_json['value'])}")return parsed_json["value"]except Exception as e:raise ValueError(f"Invalid JSON line '{json_line}': {e}")
5
17
3
91
1
818
834
818
json_line,message_type,expected_size
['parsed_json']
Union[str, list[str]]
{"Assign": 1, "If": 2, "Return": 1, "Try": 1}
6
17
6
["json.loads", "ValueError", "len", "ValueError", "len", "ValueError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_get_value_from_json_line) defined within the public class called public.The function start at line 818 and ends at 834. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [818.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions called inside which are ["json.loads", "ValueError", "len", "ValueError", "len", "ValueError"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
_assert_valid_path
def _assert_valid_path(path: str) -> None:"""Validates that the path has the format of the OS currently running."""path_obj = Path(path)if not path_obj.is_absolute():raise ValueError(f"Path {path} is not an absolute path.")
2
4
1
30
1
837
843
837
path
['path_obj']
None
{"Assign": 1, "Expr": 1, "If": 1}
3
7
3
["Path", "path_obj.is_absolute", "ValueError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"]
The function (_assert_valid_path) defined within the public class called public.The function start at line 837 and ends at 843. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called inside which are ["Path", "path_obj.is_absolute", "ValueError"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.job_group_py._download_job_output"].
aws-deadline_deadline-cloud
public
public
0
0
job_download_output
def job_download_output(step_id, task_id, output, **args):"""Download a job's output."""if task_id and not step_id:raise click.UsageError("Missing option '--step-id' required with '--task-id'")# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id", "job_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)is_json_format = True if output == "json" else Falsetry:_download_job_output(config, farm_id, queue_id, job_id, step_id, task_id, is_json_format)except Exception as e:if is_json_format:error_one_liner = str(e).replace("\n", ". ")click.echo(_get_json_line(JSON_MSG_TYPE_ERROR, error_one_liner))sys.exit(1)else:if logging.DEBUG >= logger.getEffectiveLevel():logger.exception("Exception details:")raise DeadlineOperationError(f"Failed to download output:\n{e}") from e
7
21
4
171
6
885
911
885
step_id,task_id,output,**args
['config', 'farm_id', 'job_id', 'error_one_liner', 'queue_id', 'is_json_format']
None
{"Assign": 6, "Expr": 5, "If": 3, "Try": 1}
26
27
26
["click.UsageError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "_download_job_output", "replace", "str", "click.echo", "_get_json_line", "sys.exit", "logger.getEffectiveLevel", "logger.exception", "DeadlineOperationError", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option", "click.option", "click.Choice"]
0
[]
The function (job_download_output) defined within the public class called public.The function start at line 885 and ends at 911. It contains 21 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [885.0] and does not return any value. It declares 26.0 functions, and It has 26.0 functions called inside which are ["click.UsageError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "_download_job_output", "replace", "str", "click.echo", "_get_json_line", "sys.exit", "logger.getEffectiveLevel", "logger.exception", "DeadlineOperationError", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option", "click.option", "click.Choice"].
aws-deadline_deadline-cloud
public
public
0
0
job_wait_for_completion.status_callback
def status_callback(status, elapsed_time=0, total_timeout=0):if not is_json_output:timeout_info = ""if total_timeout > 0:remaining = max(0, total_timeout - elapsed_time)timeout_info = f" [{elapsed_time:.1f}s elapsed, {remaining:.1f}s remaining]"else:timeout_info = f" [{elapsed_time:.1f}s elapsed]"# Clear the current line and update in placeclick.echo(f"\rCurrent status: {status}.{timeout_info}",nl=False,)
3
12
3
57
0
963
976
963
null
[]
None
null
0
0
0
null
0
null
The function (job_wait_for_completion.status_callback) defined within the public class called public.The function start at line 963 and ends at 976. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [963.0] and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
job_wait_for_completion
def job_wait_for_completion(max_poll_interval, timeout, output, **args):"""Wait for a job to complete and return failed step-task IDs.This command blocks until the job's taskRunStatus reaches a terminal state (SUCCEEDED, FAILED, CANCELED, SUSPENDED, or NOT_COMPATIBLE),then returns a list of any failed step-task combinations.The command uses exponential backoff for polling, starting at 0.5 seconds and doublingthe interval after each check until it reaches the maximum polling interval.Exit codes:0 - Job succeeded1 - Timeout waiting for job completion2 - Job failed (any tasks failed)3 - Job was canceled4 - Job was suspended5 - Job is not compatible"""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id", "job_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)is_json_output = output.lower() == "json"# Get job name for outputdeadline = api.get_boto3_client("deadline", config=config)job = deadline.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)job_name = job["name"]# Define a status callback for verbose outputdef status_callback(status, elapsed_time=0, total_timeout=0):if not is_json_output:timeout_info = ""if total_timeout > 0:remaining = max(0, total_timeout - elapsed_time)timeout_info = f" [{elapsed_time:.1f}s elapsed, {remaining:.1f}s remaining]"else:timeout_info = f" [{elapsed_time:.1f}s elapsed]"# Clear the current line and update in placeclick.echo(f"\rCurrent status: {status}.{timeout_info}",nl=False,)if not is_json_output:click.echo(f"Waiting for job {job_id} to complete...")try:result = api.wait_for_job_completion(farm_id=farm_id,queue_id=queue_id,job_id=job_id,max_poll_interval=max_poll_interval,timeout=timeout,config=config,status_callback=status_callback,)if is_json_output:# Return everything as JSONresponse = {"jobId": job_id,"jobName": job_name,"status": result.status,"elapsedTime": result.elapsed_time,"failedTasks": [{"stepId": task.step_id,"taskId": task.task_id,"stepName": task.step_name,"sessionId": task.session_id,}for task in result.failed_tasks],}click.echo(json.dumps(response, indent=2))else:# Use verbose output with YAML formattingclick.echo(f"Job ID: {job_id}")click.echo(f"Job Name: {job_name}")click.echo(f"Job completed with status: {result.status}")click.echo(f"Elapsed time: {result.elapsed_time:.1f} seconds")if result.failed_tasks:click.echo(f"Found {len(result.failed_tasks)} failed tasks:")failed_tasks_dict = [{"stepId": task.step_id,"taskId": task.task_id,"stepName": task.step_name,"sessionId": task.session_id,}for task in result.failed_tasks]click.echo(_cli_object_repr(failed_tasks_dict))else:click.echo("No failed tasks found.")# Determine exit code based on job statusexit_code = 0if result.status == "SUCCEEDED" and not result.failed_tasks:exit_code = 0elif result.status == "FAILED" or result.failed_tasks:exit_code = 2elif result.status == "CANCELED":exit_code = 3elif result.status == "SUSPENDED":exit_code = 4elif result.status == "ARCHIVED":exit_code = 4elif result.status == "NOT_COMPATIBLE":exit_code = 5else:# Unknown status, treat as failureexit_code = 2sys.exit(exit_code)except DeadlineOperationTimedOut as e:if is_json_output:error_response = {"error": str(e),"timeout": True,"jobId": job_id,"jobName": job_name,}click.echo(json.dumps(error_response, indent=2))else:click.echo(f"Job ID: {job_id}")click.echo(f"Job Name: {job_name}")click.echo(f"Error waiting for job completion: {e}")sys.exit(1)except DeadlineOperationError as e:if is_json_output:error_response = {"error": str(e),"jobId": job_id,"jobName": job_name,}click.echo(json.dumps(error_response, indent=2))else:click.echo(f"Job ID: {job_id}")click.echo(f"Job Name: {job_name}")click.echo(f"Error waiting for job completion: {e}")sys.exit(2)
18
103
4
564
15
928
1,078
928
max_poll_interval,timeout,output,**args
['config', 'remaining', 'timeout_info', 'error_response', 'is_json_output', 'farm_id', 'deadline', 'job_name', 'job_id', 'response', 'result', 'exit_code', 'failed_tasks_dict', 'job', 'queue_id']
None
{"Assign": 25, "Expr": 22, "If": 13, "Try": 1}
46
151
46
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "output.lower", "api.get_boto3_client", "deadline.get_job", "max", "click.echo", "click.echo", "api.wait_for_job_completion", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "click.echo", "click.echo", "len", "click.echo", "_cli_object_repr", "click.echo", "sys.exit", "str", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "sys.exit", "str", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "sys.exit", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice"]
0
[]
The function (job_wait_for_completion) defined within the public class called public.The function start at line 928 and ends at 1078. It contains 103 lines of code and it has a cyclomatic complexity of 18. It takes 4 parameters, represented as [928.0] and does not return any value. It declares 46.0 functions, and It has 46.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "output.lower", "api.get_boto3_client", "deadline.get_job", "max", "click.echo", "click.echo", "api.wait_for_job_completion", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "click.echo", "click.echo", "len", "click.echo", "_cli_object_repr", "click.echo", "sys.exit", "str", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "sys.exit", "str", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "sys.exit", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice"].
aws-deadline_deadline-cloud
public
public
0
0
job_logs
def job_logs(session_id, limit, start_time, end_time, next_token, output, timezone, **args):"""Get CloudWatch logs for a specific session.This command retrieves logs from CloudWatch for the specified session ID.By default, it returns the most recent 100 log lines, but this can beadjusted using the --limit parameter.If session-id is not provided but job-id is, the command will automaticallyselect a session using the following priority:1. If there are ongoing sessions (no endedAt time), always prefer them2. Among ongoing sessions, select the one that started most recently3. If no ongoing sessions exist, select the completed session that ended most recentlyUse --next-token with the value from a previous response to get the next page of results."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)is_json_output = output.lower() == "json"# Get job name if job_id is availabledeadline = api.get_boto3_client("deadline", config=config)job = deadline.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)job_name = job["name"]use_local_time = timezone.lower() == "local"# If session_id is not provided but job_id is, try to find the sessionif not session_id and job_id:try:# Use paginator to get all sessionspaginator = deadline.get_paginator("list_sessions")sessions = []for page in paginator.paginate(farmId=farm_id, queueId=queue_id, jobId=job_id):sessions.extend(page.get("sessions", []))if not sessions:raise DeadlineOperationError(f"No sessions found for job {job_id}")elif len(sessions) == 1:session_id = sessions[0]["sessionId"]if not is_json_output:click.echo(f"Using the only available session: {session_id}")else:# Multiple sessions found, select the latest one# Prioritize ongoing sessions (no endedAt) over completed ones# Among ongoing sessions, select the one that started most recently# Among completed sessions, select the one that ended most recentlyongoing_sessions = [s for s in sessions if "endedAt" not in s]completed_sessions = [s for s in sessions if "endedAt" in s]if ongoing_sessions:# Always prefer ongoing sessions, select the most recently started onelatest_session = max(ongoing_sessions,key=lambda s: s.get("startedAt", datetime.datetime.min.replace(tzinfo=datetime.timezone.utc)),)else:# No ongoing sessions, select the most recently completed onelatest_session = max(completed_sessions,key=lambda s: s.get("endedAt", datetime.datetime.min.replace(tzinfo=datetime.timezone.utc)),)session_id = latest_session["sessionId"]if not is_json_output:click.echo(f"Using the latest session: {session_id}")except ClientError as exc:raise DeadlineOperationError(f"Failed to list sessions for job {job_id}:\n{exc}") from exc# Ensure we have a session ID at this pointif not session_id:raise DeadlineOperationError("Session ID is required. Provide it with --session-id or specify a --job-id with at least one session.")if not is_json_output:click.echo(f"Retrieving logs for session {session_id} from log group /aws/deadline/{farm_id}/{queue_id}...")try:result = api.get_session_logs(farm_id=farm_id,queue_id=queue_id,session_id=session_id,limit=limit,start_time=start_time,end_time=end_time,next_token=next_token,config=config,)if is_json_output:# Return everything as JSONresponse = {"jobId": job_id,"jobName": job_name,"events": [{"timestamp": _format_timestamp(event.timestamp, use_local_time),"message": event.message,"ingestionTime": (_format_timestamp(event.ingestion_time, use_local_time)if event.ingestion_timeelse None),"eventId": event.event_id,}for event in result.events],"count": result.count,"nextToken": result.next_token,"logGroup": result.log_group,"logStream": result.log_stream,}click.echo(json.dumps(response, indent=2))else:# Display the logs in verbose formatif not result.events:click.echo("No logs found for the specified session.")return# Display job information if availableclick.echo(f"Job ID: {job_id}")click.echo(f"Job Name: {job_name}")for event in result.events:timestamp = _format_timestamp(event.timestamp, use_local_time)click.echo(f"[{timestamp}] {event.message}")click.echo(f"\nRetrieved {result.count} log events.")# If there are more logs available, inform the userif result.next_token:click.echo(f'More logs are available. Use --next-token "{result.next_token}" to retrieve the next page.')except Exception as e:if is_json_output:error_response = {"error": str(e)}click.echo(json.dumps(error_response, indent=2))sys.exit(1)else:raise DeadlineOperationError(f"Error retrieving logs: {e}")
24
109
8
643
19
1,110
1,266
1,110
session_id,limit,start_time,end_time,next_token,output,timezone,**args
['paginator', 'config', 'completed_sessions', 'job_name', 'use_local_time', 'timestamp', 'is_json_output', 'farm_id', 'sessions', 'ongoing_sessions', 'session_id', 'deadline', 'latest_session', 'job_id', 'response', 'result', 'error_response', 'job', 'queue_id']
None
{"Assign": 21, "Expr": 14, "For": 2, "If": 12, "Return": 1, "Try": 2}
56
157
56
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "output.lower", "api.get_boto3_client", "deadline.get_job", "timezone.lower", "deadline.get_paginator", "paginator.paginate", "sessions.extend", "page.get", "DeadlineOperationError", "len", "click.echo", "max", "s.get", "datetime.datetime.min.replace", "max", "s.get", "datetime.datetime.min.replace", "click.echo", "DeadlineOperationError", "DeadlineOperationError", "click.echo", "api.get_session_logs", "_format_timestamp", "_format_timestamp", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "_format_timestamp", "click.echo", "click.echo", "click.echo", "str", "click.echo", "json.dumps", "sys.exit", "DeadlineOperationError", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option", "click.Choice"]
0
[]
The function (job_logs) defined within the public class called public.The function start at line 1110 and ends at 1266. It contains 109 lines of code and it has a cyclomatic complexity of 24. It takes 8 parameters, represented as [1110.0] and does not return any value. It declares 56.0 functions, and It has 56.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "output.lower", "api.get_boto3_client", "deadline.get_job", "timezone.lower", "deadline.get_paginator", "paginator.paginate", "sessions.extend", "page.get", "DeadlineOperationError", "len", "click.echo", "max", "s.get", "datetime.datetime.min.replace", "max", "s.get", "datetime.datetime.min.replace", "click.echo", "DeadlineOperationError", "DeadlineOperationError", "click.echo", "api.get_session_logs", "_format_timestamp", "_format_timestamp", "click.echo", "json.dumps", "click.echo", "click.echo", "click.echo", "_format_timestamp", "click.echo", "click.echo", "click.echo", "str", "click.echo", "json.dumps", "sys.exit", "DeadlineOperationError", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option", "click.Choice"].
aws-deadline_deadline-cloud
public
public
0
0
job_trace_schedule.time_int
def time_int(timestamp: datetime.datetime):return int((timestamp - started_at) / datetime.timedelta(microseconds=1))
1
2
1
27
0
1,409
1,410
1,409
null
[]
None
null
0
0
0
null
0
null
The function (job_trace_schedule.time_int) defined within the public class called public.The function start at line 1409 and ends at 1410. 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
job_trace_schedule.duration_of
def duration_of(resource):try:return time_int(resource.get("endedAt", trace_end_utc)) - time_int(resource["startedAt"])except KeyError:return 0
2
7
1
32
0
1,412
1,418
1,412
null
[]
None
null
0
0
0
null
0
null
The function (job_trace_schedule.duration_of) defined within the public class called public.The function start at line 1412 and ends at 1418. 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..
aws-deadline_deadline-cloud
public
public
0
0
job_trace_schedule
def job_trace_schedule(verbose, trace_format, trace_file, **args):"""EXPERIMENTAL - Generate statistics from a job.To visualize the trace output file when providing the options"--trace-format chrome --trace-file <output>.json", usethe https://ui.perfetto.dev Tracing UI and choose "Open trace file"."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id", "job_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)job_id = config_file.get_setting("defaults.job_id", config=config)if trace_file and not trace_format:raise DeadlineOperationError("Error: Must provide --trace-format with --trace-file.")deadline = api.get_boto3_client("deadline", config=config)trace_end_utc = datetime.datetime.now(datetime.timezone.utc)click.echo("Getting the job...")job = deadline.get_job(farmId=farm_id, queueId=queue_id, jobId=job_id)job.pop("ResponseMetadata", None)if "startedAt" not in job:raise DeadlineOperationError("No trace available - Job hasn't started yet, exiting")started_at = job["startedAt"]click.echo("Getting all the sessions for the job...")response = deadline.list_sessions(farmId=farm_id, queueId=queue_id, jobId=job_id)while "nextToken" in response:old_list = response["sessions"]response = deadline.list_sessions(farmId=farm_id,queueId=queue_id,jobId=job_id,nextToken=response["nextToken"],)response["sessions"] = old_list + response["sessions"]response.pop("ResponseMetadata", None)sessions = sorted(response["sessions"], key=lambda session: session["startedAt"])click.echo("Getting all the session actions for the job...")for session in sessions:response = deadline.list_session_actions(farmId=farm_id,queueId=queue_id,jobId=job_id,sessionId=session["sessionId"],)while "nextToken" in response:old_list = response["sessionActions"]response = deadline.list_session_actions(farmId=farm_id,queueId=queue_id,jobId=job_id,sessionId=session["sessionId"],nextToken=response["nextToken"],)response["sessionActions"] = old_list + response["sessionActions"]response.pop("ResponseMetadata", None)session["actions"] = response["sessionActions"]# Cache steps and tasks by their id, to only get each oncesteps: dict[str, Any] = {}tasks: dict[str, Any] = {}with click.progressbar(# type: ignore[var-annotated]length=len(sessions), label="Getting all the steps and tasks for the job...") as progressbar:for index, session in enumerate(sessions):session["index"] = indexfor action in session["actions"]:step_id = action["definition"].get("taskRun", {}).get("stepId")task_id = action["definition"].get("taskRun", {}).get("taskId")if step_id and task_id:if "step" not in session:if step_id in steps:step = steps[step_id]else:step = deadline.get_step(farmId=farm_id,queueId=queue_id,jobId=job_id,stepId=step_id,)step.pop("ResponseMetadata", None)steps[step_id] = stepsession["step"] = stepelif session["step"]["stepId"] != step_id:# The session itself doesn't have a step id, but for now the scheduler always creates new# sessions for new steps.raise DeadlineOperationError(f"Session {session['sessionId']} ran more than one step! When this code was"" written that wasn't possible.")if task_id in tasks:task = tasks[task_id]else:task = deadline.get_task(farmId=farm_id,queueId=queue_id,jobId=job_id,stepId=step_id,taskId=task_id,)task.pop("ResponseMetadata", None)tasks[task_id] = taskaction["task"] = taskprogressbar.update(1)# Collect the worker IDs that ran the sessions, and give them indexes to act as PIDs in the tracing fileworker_ids = {session["workerId"] for session in sessions}workers = {worker_id: index for index, worker_id in enumerate(worker_ids)}click.echo("Processing the trace data...")trace_events = []def time_int(timestamp: datetime.datetime):return int((timestamp - started_at) / datetime.timedelta(microseconds=1))def duration_of(resource):try:return time_int(resource.get("endedAt", trace_end_utc)) - time_int(resource["startedAt"])except KeyError:return 0accumulators = {"sessionCount": 0,"sessionActionCount": 0,"taskRunCount": 0,"envActionCount": 0,"syncJobAttachmentsCount": 0,"sessionDuration": 0,"sessionActionDuration": 0,"taskRunDuration": 0,"envActionDuration": 0,"syncJobAttachmentsDuration": 0,}for session in sessions:accumulators["sessionCount"] += 1accumulators["sessionDuration"] += duration_of(session)pid = workers[session["workerId"]]session_event_name = f"{session['step']['name']} - {session['index']}"if "endedAt" not in session:session_event_name = f"{session_event_name} - In Progress"trace_events.append({"name": session_event_name,"cat": "SESSION","ph": "B",# Begin Event"ts": time_int(session["startedAt"]),"pid": pid,"tid": 0,"args": {"sessionId": session["sessionId"],"workerId": session["workerId"],"fleetId": session["fleetId"],"lifecycleStatus": session["lifecycleStatus"],},})for action in session["actions"]:accumulators["sessionActionCount"] += 1accumulators["sessionActionDuration"] += duration_of(action)name = action["sessionActionId"]action_type = list(action["definition"].keys())[0]if action_type == "taskRun":accumulators["taskRunCount"] += 1accumulators["taskRunDuration"] += duration_of(action)task = action["task"]parameters = task.get("parameters", {})name = ",".join(f"{param}={list(parameters[param].values())[0]}" for param in parameters)if not name:name = "<No Task Params>"elif action_type in ("envEnter", "envExit"):accumulators["envActionCount"] += 1accumulators["envActionDuration"] += duration_of(action)name = action["definition"][action_type]["environmentId"].split(":")[-1]elif action_type == "syncInputJobAttachments":accumulators["syncJobAttachmentsCount"] += 1accumulators["syncJobAttachmentsDuration"] += duration_of(action)if "stepId" in action["definition"][action_type]:name = "Sync Job Attchmnt (Dependencies)"else:name = "Sync Job Attchmnt (Submitted)"if "endedAt" not in action:name = f"{name} - In Progress"if "startedAt" in action:trace_events.append({"name": name,"cat": action_type,"ph": "X",# Complete Event"ts": time_int(action["startedAt"]),"dur": duration_of(action),"pid": pid,"tid": 0,"args": {"sessionActionId": action["sessionActionId"],"status": action["status"],"stepName": session["step"]["name"],},})trace_events.append({"name": session_event_name,"cat": "SESSION","ph": "E",# End Event"ts": time_int(session.get("endedAt", trace_end_utc)),"pid": pid,"tid": 0,})if verbose:click.echo(" ==== TRACE DATA ====")click.echo(_cli_object_repr(job))click.echo("")click.echo(_cli_object_repr(sessions))click.echo("")click.echo(" ==== SUMMARY ====")click.echo("")click.echo(f"Session Count: {accumulators['sessionCount']}")session_total_duration = accumulators["sessionDuration"]click.echo(f"Session Total Duration: {datetime.timedelta(microseconds=session_total_duration)}")click.echo(f"Session Action Count: {accumulators['sessionActionCount']}")click.echo(f"Session Action Total Duration: {datetime.timedelta(microseconds=accumulators['sessionActionDuration'])}")click.echo(f"Task Run Count: {accumulators['taskRunCount']}")task_run_total_duration = accumulators["taskRunDuration"]click.echo(f"Task Run Total Duration: {datetime.timedelta(microseconds=task_run_total_duration)} ({100 * task_run_total_duration / session_total_duration:.1f}%)")click.echo(f"Non-Task Run Count: {accumulators['sessionActionCount'] - accumulators['taskRunCount']}")non_task_run_total_duration = (accumulators["sessionActionDuration"] - accumulators["taskRunDuration"])click.echo(f"Non-Task Run Total Duration: {datetime.timedelta(microseconds=non_task_run_total_duration)} ({100 * non_task_run_total_duration / session_total_duration:.1f}%)")click.echo(f"Sync Job Attachments Count: {accumulators['syncJobAttachmentsCount']}")sync_job_attachments_total_duration = accumulators["syncJobAttachmentsDuration"]click.echo(f"Sync Job Attachments Total Duration: {datetime.timedelta(microseconds=sync_job_attachments_total_duration)} ({100 * sync_job_attachments_total_duration / session_total_duration:.1f}%)")click.echo(f"Env Action Count: {accumulators['envActionCount']}")env_action_total_duration = accumulators["envActionDuration"]click.echo(f"Env Action Total Duration: {datetime.timedelta(microseconds=env_action_total_duration)} ({100 * env_action_total_duration / session_total_duration:.1f}%)")click.echo("")within_session_overhead_duration = (accumulators["sessionDuration"] - accumulators["sessionActionDuration"])click.echo(f"Within-session Overhead Duration: {datetime.timedelta(microseconds=within_session_overhead_duration)} ({100 * within_session_overhead_duration / session_total_duration:.1f}%)")click.echo(f"Within-session Overhead Duration Per Action: {datetime.timedelta(microseconds=(accumulators['sessionDuration'] - accumulators['sessionActionDuration']) / accumulators['sessionActionCount'])}")tracing_data: dict[str, Any] = {"traceEvents": trace_events,# "displayTimeUnits": "s","otherData": {"farmId": farm_id,"queueId": queue_id,"jobId": job_id,"jobName": job["name"],"startedAt": job["startedAt"].isoformat(sep="T"),},}if "endedAt" in job:tracing_data["otherData"]["endedAt"] = job["endedAt"].isoformat(sep="T")tracing_data["otherData"].update(accumulators)if trace_file:with open(trace_file, "w", encoding="utf8") as f:json.dump(tracing_data, f, indent=1)
31
254
4
1,448
30
1,285
1,588
1,285
verbose,trace_format,trace_file,**args
['config', 'worker_ids', 'session_event_name', 'sync_job_attachments_total_duration', 'task_run_total_duration', 'env_action_total_duration', 'within_session_overhead_duration', 'trace_events', 'accumulators', 'farm_id', 'step', 'sessions', 'non_task_run_total_duration', 'parameters', 'old_list', 'deadline', 'pid', 'session_total_duration', 'started_at', 'job_id', 'response', 'name', 'workers', 'action_type', 'step_id', 'task', 'task_id', 'trace_end_utc', 'job', 'queue_id']
Returns
{"AnnAssign": 3, "Assign": 53, "AugAssign": 10, "Expr": 38, "For": 5, "If": 18, "Return": 3, "Try": 1, "While": 2, "With": 2}
106
304
106
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "DeadlineOperationError", "api.get_boto3_client", "datetime.datetime.now", "click.echo", "deadline.get_job", "job.pop", "DeadlineOperationError", "click.echo", "deadline.list_sessions", "deadline.list_sessions", "response.pop", "sorted", "click.echo", "deadline.list_session_actions", "deadline.list_session_actions", "response.pop", "click.progressbar", "len", "enumerate", "get", "get", "get", "get", "deadline.get_step", "step.pop", "DeadlineOperationError", "deadline.get_task", "task.pop", "progressbar.update", "enumerate", "click.echo", "int", "datetime.timedelta", "time_int", "resource.get", "time_int", "duration_of", "trace_events.append", "time_int", "duration_of", "list", "keys", "duration_of", "task.get", "join", "list", "values", "duration_of", "split", "duration_of", "trace_events.append", "time_int", "duration_of", "trace_events.append", "time_int", "session.get", "click.echo", "click.echo", "_cli_object_repr", "click.echo", "click.echo", "_cli_object_repr", "click.echo", "click.echo", "click.echo", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "datetime.timedelta", "isoformat", "isoformat", "update", "open", "json.dump", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"]
0
[]
The function (job_trace_schedule) defined within the public class called public.The function start at line 1285 and ends at 1588. It contains 254 lines of code and it has a cyclomatic complexity of 31. It takes 4 parameters, represented as [1285.0], and this function return a value. It declares 106.0 functions, and It has 106.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "config_file.get_setting", "DeadlineOperationError", "api.get_boto3_client", "datetime.datetime.now", "click.echo", "deadline.get_job", "job.pop", "DeadlineOperationError", "click.echo", "deadline.list_sessions", "deadline.list_sessions", "response.pop", "sorted", "click.echo", "deadline.list_session_actions", "deadline.list_session_actions", "response.pop", "click.progressbar", "len", "enumerate", "get", "get", "get", "get", "deadline.get_step", "step.pop", "DeadlineOperationError", "deadline.get_task", "task.pop", "progressbar.update", "enumerate", "click.echo", "int", "datetime.timedelta", "time_int", "resource.get", "time_int", "duration_of", "trace_events.append", "time_int", "duration_of", "list", "keys", "duration_of", "task.get", "join", "list", "values", "duration_of", "split", "duration_of", "trace_events.append", "time_int", "duration_of", "trace_events.append", "time_int", "session.get", "click.echo", "click.echo", "_cli_object_repr", "click.echo", "click.echo", "_cli_object_repr", "click.echo", "click.echo", "click.echo", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "click.echo", "datetime.timedelta", "click.echo", "datetime.timedelta", "isoformat", "isoformat", "update", "open", "json.dump", "cli_job.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
cli_manifest
def cli_manifest():"""Commands to work with AWS Deadline Cloud Job Attachments."""
1
1
0
5
0
50
53
50
[]
None
{"Expr": 1}
1
4
1
["main.group"]
0
[]
The function (cli_manifest) defined within the public class called public.The function start at line 50 and ends at 53. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called inside which is ["main.group"].
aws-deadline_deadline-cloud
public
public
0
0
manifest_snapshot
def manifest_snapshot(root: str,destination: str,name: str,include: List[str],exclude: List[str],include_exclude_config: str,diff: str,force_rehash: bool,json: bool,**args,):"""Creates manifest of files specified by root directory."""logger: ClickLogger = ClickLogger(is_json=json)if not os.path.isdir(root):raise NonValidInputError(f"Specified root directory {root} does not exist.")if destination and not os.path.isdir(destination):raise NonValidInputError(f"Specified destination directory {destination} does not exist.")elif destination is None:destination = rootlogger.echo(f"Manifest creation path defaulted to {root} \n")manifest_out = _manifest_snapshot(root=root,destination=destination,name=name,include=include,exclude=exclude,include_exclude_config=include_exclude_config,diff=diff,force_rehash=force_rehash,logger=logger,)if manifest_out:if (sys.platform == "win32"and len(manifest_out.manifest) >= WINDOWS_MAX_PATH_LENGTHand not _is_windows_long_path_registry_enabled()):long_manifest_path_warning = f"""WARNING: Manifest file path {manifest_out.manifest} exceeds Windows path length limit. This may cause unexpected issues.For details and a fix using the registry, see: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation"""logger.echo(click.style(long_manifest_path_warning,fg="yellow",))logger.json(dict(dataclasses.asdict(manifest_out), **{"warning": long_manifest_path_warning}))else:logger.json(dataclasses.asdict(manifest_out))
9
48
10
232
3
103
157
103
root,destination,name,include,exclude,include_exclude_config,diff,force_rehash,json,**args
['destination', 'long_manifest_path_warning', 'manifest_out']
None
{"AnnAssign": 1, "Assign": 3, "Expr": 5, "If": 5}
26
55
26
["ClickLogger", "os.path.isdir", "NonValidInputError", "os.path.isdir", "NonValidInputError", "logger.echo", "_manifest_snapshot", "len", "_is_windows_long_path_registry_enabled", "logger.echo", "click.style", "logger.json", "dict", "dataclasses.asdict", "logger.json", "dataclasses.asdict", "cli_manifest.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (manifest_snapshot) defined within the public class called public.The function start at line 103 and ends at 157. It contains 48 lines of code and it has a cyclomatic complexity of 9. It takes 10 parameters, represented as [103.0] and does not return any value. It declares 26.0 functions, and It has 26.0 functions called inside which are ["ClickLogger", "os.path.isdir", "NonValidInputError", "os.path.isdir", "NonValidInputError", "logger.echo", "_manifest_snapshot", "len", "_is_windows_long_path_registry_enabled", "logger.echo", "click.style", "logger.json", "dict", "dataclasses.asdict", "logger.json", "dataclasses.asdict", "cli_manifest.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
manifest_diff
def manifest_diff(root: str,manifest: str,include: List[str],exclude: List[str],include_exclude_config: str,force_rehash: bool,json: bool,**args,):"""Check file differences between a directory and specified manifest."""logger: ClickLogger = ClickLogger(is_json=json)if not os.path.isfile(manifest):raise NonValidInputError(f"Specified manifest file {manifest} does not exist. ")if not os.path.isdir(root):raise NonValidInputError(f"Specified root directory {root} does not exist. ")# Perform the diff.differences: ManifestDiff = _manifest_diff(manifest=manifest,root=root,include=include,exclude=exclude,include_exclude_config=include_exclude_config,force_rehash=force_rehash,logger=logger,)# Print results to console.if json:logger.json(dataclasses.asdict(differences), indent=4)else:logger.echo(f"Manifest Diff of root directory: {root}")all_files = _glob_files(root=root,include=include,exclude=exclude,include_exclude_config=include_exclude_config,)pretty_print_cli(root=root, all_files=all_files, manifest_diff=differences)
4
35
8
183
1
198
240
198
root,manifest,include,exclude,include_exclude_config,force_rehash,json,**args
['all_files']
None
{"AnnAssign": 2, "Assign": 1, "Expr": 4, "If": 3}
19
43
19
["ClickLogger", "os.path.isfile", "NonValidInputError", "os.path.isdir", "NonValidInputError", "_manifest_diff", "logger.json", "dataclasses.asdict", "logger.echo", "_glob_files", "pretty_print_cli", "cli_manifest.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (manifest_diff) defined within the public class called public.The function start at line 198 and ends at 240. It contains 35 lines of code and it has a cyclomatic complexity of 4. It takes 8 parameters, represented as [198.0] and does not return any value. It declares 19.0 functions, and It has 19.0 functions called inside which are ["ClickLogger", "os.path.isfile", "NonValidInputError", "os.path.isdir", "NonValidInputError", "_manifest_diff", "logger.json", "dataclasses.asdict", "logger.echo", "_glob_files", "pretty_print_cli", "cli_manifest.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
manifest_download
def manifest_download(download_dir: str,job_id: str,step_id: str,asset_type: str,json: bool,**args,):"""Downloads input/output manifests of a submitted job as per provided asset_type"""logger: ClickLogger = ClickLogger(is_json=json)if not os.path.isdir(download_dir):raise NonValidInputError(f"Specified destination directory {download_dir} does not exist. ")# setup configconfig: Optional[ConfigParser] = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)queue_id: str = config_file.get_setting("defaults.queue_id", config=config)farm_id: str = config_file.get_setting("defaults.farm_id", config=config)boto3_session: boto3.Session = api.get_boto3_session(config=config)output = _manifest_download(download_dir=download_dir,farm_id=farm_id,queue_id=queue_id,job_id=job_id,step_id=step_id,asset_type=AssetType(asset_type),boto3_session=boto3_session,logger=logger,)logger.json(dataclasses.asdict(output))
2
28
6
168
1
269
303
269
download_dir,job_id,step_id,asset_type,json,**args
['output']
None
{"AnnAssign": 5, "Assign": 1, "Expr": 2, "If": 1}
21
35
21
["ClickLogger", "os.path.isdir", "NonValidInputError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_session", "_manifest_download", "AssetType", "logger.json", "dataclasses.asdict", "cli_manifest.command", "click.argument", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"]
0
[]
The function (manifest_download) defined within the public class called public.The function start at line 269 and ends at 303. It contains 28 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [269.0] and does not return any value. It declares 21.0 functions, and It has 21.0 functions called inside which are ["ClickLogger", "os.path.isdir", "NonValidInputError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_session", "_manifest_download", "AssetType", "logger.json", "dataclasses.asdict", "cli_manifest.command", "click.argument", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
manifest_upload
def manifest_upload(manifest_file: str,s3_cas_uri: str,s3_manifest_prefix: str,json: bool,**args,):# Input checking.if not manifest_file or not os.path.isfile(manifest_file):raise NonValidInputError(f"Specified manifest {manifest_file} does not exist. ")# Where will we upload the manifest to?required: set[str] = set()if not s3_cas_uri:required = {"farm_id", "queue_id"}config: Optional[ConfigParser] = _apply_cli_options_to_config(required_options=required, **args)# Loggerlogger: ClickLogger = ClickLogger(is_json=json)bucket_name: str = ""session: boto3.Session = api.get_boto3_session(config=config)if not s3_cas_uri:farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)deadline = api.get_boto3_client("deadline", config=config)queue = deadline.get_queue(farmId=farm_id,queueId=queue_id,)queue_ja_settings: JobAttachmentS3Settings = JobAttachmentS3Settings(**queue["jobAttachmentSettings"])bucket_name = queue_ja_settings.s3BucketNamecas_path = queue_ja_settings.rootPrefix# IF we supplied a farm and queue, use the queue credentials.session = api.get_queue_user_boto3_session(deadline=deadline,config=config,farm_id=farm_id,queue_id=queue_id,queue_display_name=queue["displayName"],)else:# Self supplied cas path.uri_ja_settings: JobAttachmentS3Settings = JobAttachmentS3Settings.from_s3_root_uri(s3_cas_uri)bucket_name = uri_ja_settings.s3BucketNamecas_path = uri_ja_settings.rootPrefixlogger.echo(f"Uploading Manifest to {bucket_name} {cas_path} {S3_MANIFEST_FOLDER_NAME}, prefix: {s3_manifest_prefix}")_manifest_upload(manifest_file=manifest_file,s3_bucket_name=bucket_name,s3_cas_prefix=cas_path,s3_key_prefix=s3_manifest_prefix,boto_session=session,logger=logger,)logger.echo("Uploading successful!")
5
54
5
278
8
324
390
324
manifest_file,s3_cas_uri,s3_manifest_prefix,json,**args
['queue', 'farm_id', 'deadline', 'cas_path', 'session', 'required', 'bucket_name', 'queue_id']
None
{"AnnAssign": 7, "Assign": 10, "Expr": 3, "If": 3}
24
67
24
["os.path.isfile", "NonValidInputError", "set", "_apply_cli_options_to_config", "ClickLogger", "api.get_boto3_session", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.get_queue", "JobAttachmentS3Settings", "api.get_queue_user_boto3_session", "JobAttachmentS3Settings.from_s3_root_uri", "logger.echo", "_manifest_upload", "logger.echo", "cli_manifest.command", "click.argument", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (manifest_upload) defined within the public class called public.The function start at line 324 and ends at 390. It contains 54 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [324.0] and does not return any value. It declares 24.0 functions, and It has 24.0 functions called inside which are ["os.path.isfile", "NonValidInputError", "set", "_apply_cli_options_to_config", "ClickLogger", "api.get_boto3_session", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.get_queue", "JobAttachmentS3Settings", "api.get_queue_user_boto3_session", "JobAttachmentS3Settings.from_s3_root_uri", "logger.echo", "_manifest_upload", "logger.echo", "cli_manifest.command", "click.argument", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
cli_queue
def cli_queue():"""Commands for queues."""
1
1
0
5
0
39
42
39
[]
None
{"Expr": 1}
1
4
1
["main.group"]
0
[]
The function (cli_queue) defined within the public class called public.The function start at line 39 and ends at 42. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called inside which is ["main.group"].
aws-deadline_deadline-cloud
public
public
0
0
queue_list
def queue_list(**args):"""Lists the available queues."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)try:response = api.list_queues(farmId=farm_id, config=config)except ClientError as exc:raise DeadlineOperationError(f"Failed to get Queues from Deadline:\n{exc}") from exc# Select which fields to print and in which orderstructured_queue_list = [{field: queue[field] for field in ["queueId", "displayName"]}for queue in response["queues"]]click.echo(_cli_object_repr(structured_queue_list))
4
12
1
97
4
49
69
49
**args
['farm_id', 'config', 'structured_queue_list', 'response']
None
{"Assign": 4, "Expr": 2, "Try": 1}
9
21
9
["_apply_cli_options_to_config", "config_file.get_setting", "api.list_queues", "DeadlineOperationError", "click.echo", "_cli_object_repr", "cli_queue.command", "click.option", "click.option"]
0
[]
The function (queue_list) defined within the public class called public.The function start at line 49 and ends at 69. It contains 12 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has 9.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "api.list_queues", "DeadlineOperationError", "click.echo", "_cli_object_repr", "cli_queue.command", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
queue_export_credentials
def queue_export_credentials(mode, output_format, **args):"""Export queue credentials in a format compatible with AWS SDK credentials_process."""start_time = time.time()is_success = Trueerror_type = None# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)queue_id: str = config_file.get_setting("defaults.queue_id", config=config)farm_id: str = config_file.get_setting("defaults.farm_id", config=config)try:# Call the appropriate API based on modeif mode.upper() == "USER":response = api.assume_queue_role_for_user(farmId=farm_id, queueId=queue_id, config=config)elif mode.upper() == "READ":response = api.assume_queue_role_for_read(farmId=farm_id, queueId=queue_id, config=config)else:is_success = Falseerror_type = "InvalidMode"raise DeadlineOperationError(f"Invalid mode: {mode}")# Format the response according to the AWS SDK credentials_process formatif output_format.lower() == "credentials_process":credentials = response["credentials"]formatted_credentials = {"Version": 1,"AccessKeyId": credentials["accessKeyId"],"SecretAccessKey": credentials["secretAccessKey"],"SessionToken": credentials["sessionToken"],"Expiration": credentials["expiration"].isoformat(),}click.echo(json.dumps(formatted_credentials, indent=2))else:is_success = Falseerror_type = "InvalidOutputFormat"raise DeadlineOperationError(f"Invalid output format: {output_format}")except ClientError as exc:is_success = Falseerror_type = "ClientError"if "AccessDenied" in str(exc):raise DeadlineOperationError(f"Insufficient permissions to assume the requested queue role: {exc}") from excelif "UnrecognizedClientException" in str(exc):raise DeadlineOperationError(f"Authentication failed. Please run 'deadline auth login' or check your AWS credentials: {exc}") from excelse:raise DeadlineOperationError(f"Failed to get credentials from AWS Deadline Cloud:\n{exc}") from excfinally:# Record telemetryduration_ms = int((time.time() - start_time) * 1000)api._telemetry.get_deadline_cloud_library_telemetry_client().record_event("com.amazon.rum.deadline.queue_export_credentials",{"mode": mode,"queue_id": queue_id,"output_format": output_format,"is_success": is_success,"error_type": error_type if not is_success else None,"duration_ms": duration_ms,},)
9
62
3
337
8
89
162
89
mode,output_format,**args
['config', 'formatted_credentials', 'error_type', 'is_success', 'response', 'start_time', 'credentials', 'duration_ms']
None
{"AnnAssign": 2, "Assign": 15, "Expr": 3, "If": 5, "Try": 1}
31
74
31
["time.time", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "mode.upper", "api.assume_queue_role_for_user", "mode.upper", "api.assume_queue_role_for_read", "DeadlineOperationError", "output_format.lower", "isoformat", "click.echo", "json.dumps", "DeadlineOperationError", "str", "DeadlineOperationError", "str", "DeadlineOperationError", "DeadlineOperationError", "int", "time.time", "record_event", "api._telemetry.get_deadline_cloud_library_telemetry_client", "cli_queue.command", "click.option", "click.option", "click.option", "click.Choice", "click.option", "click.Choice", "click.option"]
0
[]
The function (queue_export_credentials) defined within the public class called public.The function start at line 89 and ends at 162. It contains 62 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [89.0] and does not return any value. It declares 31.0 functions, and It has 31.0 functions called inside which are ["time.time", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "mode.upper", "api.assume_queue_role_for_user", "mode.upper", "api.assume_queue_role_for_read", "DeadlineOperationError", "output_format.lower", "isoformat", "click.echo", "json.dumps", "DeadlineOperationError", "str", "DeadlineOperationError", "str", "DeadlineOperationError", "DeadlineOperationError", "int", "time.time", "record_event", "api._telemetry.get_deadline_cloud_library_telemetry_client", "cli_queue.command", "click.option", "click.option", "click.option", "click.Choice", "click.option", "click.Choice", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
queue_paramdefs
def queue_paramdefs(**args):"""Lists a Queue's Parameters Definitions."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)try:response = api.get_queue_parameter_definitions(farmId=farm_id, queueId=queue_id)except ClientError as exc:raise DeadlineOperationError(f"Failed to get Queue Parameter Definitions from Deadline:\n{exc}") from excclick.echo(_cli_object_repr(response))
2
11
1
84
4
170
187
170
**args
['farm_id', 'config', 'response', 'queue_id']
None
{"Assign": 4, "Expr": 2, "Try": 1}
11
18
11
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_queue_parameter_definitions", "DeadlineOperationError", "click.echo", "_cli_object_repr", "cli_queue.command", "click.option", "click.option", "click.option"]
0
[]
The function (queue_paramdefs) defined within the public class called public.The function start at line 170 and ends at 187. It contains 11 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 11.0 functions, and It has 11.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_queue_parameter_definitions", "DeadlineOperationError", "click.echo", "_cli_object_repr", "cli_queue.command", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
queue_get
def queue_get(**args):"""Get the details of a queue.If Queue ID is not provided, returns the configured default Queue."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)deadline = api.get_boto3_client("deadline", config=config)response = deadline.get_queue(farmId=farm_id, queueId=queue_id)response.pop("ResponseMetadata", None)click.echo(_cli_object_repr(response))
1
8
1
89
5
195
211
195
**args
['config', 'farm_id', 'deadline', 'response', 'queue_id']
None
{"Assign": 5, "Expr": 3}
12
17
12
["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.get_queue", "response.pop", "click.echo", "_cli_object_repr", "cli_queue.command", "click.option", "click.option", "click.option"]
0
[]
The function (queue_get) defined within the public class called public.The function start at line 195 and ends at 211. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 12.0 functions, and It has 12.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_client", "deadline.get_queue", "response.pop", "click.echo", "_cli_object_repr", "cli_queue.command", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
sync_output
def sync_output(json: bool,bootstrap_lookback_minutes: float,checkpoint_dir: str,force_bootstrap: bool,ignore_storage_profiles: bool,conflict_resolution: str,dry_run: bool,**args,):"""Downloads any new job attachments output for all jobs in a queue since the last run of the same command.When run for the first time or with the --force-bootstrap option, it starts downloading from --bootstrap-lookback-minutesin the past. When run each subsequent time, it loadsthe previous checkpoint and continueswhere it left off.With default options, the sync-output operation requires a storage profile defined in the deadline client configurationor provided with the --storage-profile-id option. Storage profiles are used to generate path mappings when a job wassubmitted from a machine with a different operating system or file system mount locations than the machine downloading outputs.If you only submit and download jobs from the same operating system and mount locations, you can use the --ignore-storage-profiles option."""api._session.session_context["cli-command-name"] = "deadline.queue.sync-output"if sys.version_info < (3, 9):raise DeadlineOperationError("The sync-output command requires Python version 3.9 or later")if ignore_storage_profiles and args.get("storage_profile_id") is not None:raise click.UsageError("Options '--storage-profile-id' and '--ignore-storage-profiles' cannot be provided together")logger: ClickLogger = ClickLogger(is_json=json)# Expand '~' to home directory and create the checkpoint directory if necessarycheckpoint_dir = os.path.abspath(os.path.expanduser(checkpoint_dir))os.makedirs(checkpoint_dir, exist_ok=True)# Check that download progress location is writableif not os.access(checkpoint_dir, os.W_OK):raise DeadlineOperationError(f"Download progress checkpoint directory {checkpoint_dir} exists but is not writable, please provide write permissions")# Get a temporary config object with the standard options handledconfig: Optional[ConfigParser] = _apply_cli_options_to_config(required_options={"farm_id", "queue_id"}, **args)# Get the default configsfarm_id = config_file.get_setting("defaults.farm_id", config=config)queue_id = config_file.get_setting("defaults.queue_id", config=config)boto3_session: boto3.Session = api.get_boto3_session(config=config)deadline = get_session_client(boto3_session, "deadline")if ignore_storage_profiles:local_storage_profile_id = Nonelogger.echo("Ignoring all storage profiles.")else:local_storage_profile_id = config_file.get_setting("settings.storage_profile_id", config=config)if not local_storage_profile_id:raise DeadlineOperationError("The sync-output operation requires a storage profile defined in the deadline client configuration or ""provided with the --storage-profile-id option.\n\n""Storage profiles are used to generate path mappings when a job was submitted from a machine with a different ""operating system or file system mount locations than the machine downloading outputs. See ""https://docs.aws.amazon.com/deadline-cloud/latest/developerguide/modeling-your-shared-filesystem-locations-with-storage-profiles.html ""for more information.\n\n""If you only submit and download jobs from the same operating system and mount locations, you can use the --ignore-storage-profiles option.")try:local_storage_profile = deadline.get_storage_profile_for_queue(farmId=farm_id,queueId=queue_id,storageProfileId=local_storage_profile_id,)except ClientError as e:id_source = ("configured locally"if args.get("storage_profile_id") is Noneelse "provided with --storage-profile-id")raise DeadlineOperationError(f"Could not retrieve the storage profile {local_storage_profile_id!r}, {id_source}, from Deadline Cloud:\n{e}")# Get download progress file name appended by the queue id and storage profile id - a unique progress file exists per queue/storage profiledownload_checkpoint_file_name: str = f"{queue_id}_{local_storage_profile_id or 'ignore-storage-profiles'}_{DOWNLOAD_CHECKPOINT_FILE_NAME}"# Get saved progress file full path now that we've validated all file inputs are validcheckpoint_file_path: str = os.path.join(checkpoint_dir, download_checkpoint_file_name)queue = deadline.get_queue(farmId=farm_id, queueId=queue_id)if "jobAttachmentSettings" not in queue:raise DeadlineOperationError(f"Queue '{queue['displayName']}' does not have job attachments configured.")logger.echo(f"Started incremental download for queue: {queue['displayName']}")logger.echo(f"Checkpoint: {checkpoint_file_path}")logger.echo()if local_storage_profile_id:logger.echo(f"Mapping job output paths to the local storage profile {local_storage_profile['displayName']} ({local_storage_profile_id})")logger.echo("File system locations for the storage profile are:")for location in local_storage_profile["fileSystemLocations"]:logger.echo(f"{location['name']}: {location['path']}")logger.echo()# Perform incremental download while holding a process id lockpid_lock_file_path: str = os.path.join(checkpoint_dir, f"{download_checkpoint_file_name}.pid")with PidFileLock(pid_lock_file_path,operation_name="incremental output download",):checkpoint: IncrementalDownloadStateif force_bootstrap or not os.path.exists(checkpoint_file_path):bootstrap_timestamp = datetime.now(timezone.utc) - timedelta(minutes=bootstrap_lookback_minutes)# Bootstrap with the specified lookback durationcheckpoint = IncrementalDownloadState(local_storage_profile_id=local_storage_profile_id,downloads_started_timestamp=bootstrap_timestamp,)# Print the bootstrap time in local timeif force_bootstrap:logger.echo(f"Bootstrap forced, lookback is {bootstrap_lookback_minutes} minutes")else:logger.echo(f"Checkpoint not found, lookback is {bootstrap_lookback_minutes} minutes")logger.echo(f"Initializing from: {bootstrap_timestamp.astimezone().isoformat()}")else:# Load the incremental download checkpoint filecheckpoint = IncrementalDownloadState.from_file(checkpoint_file_path)# Print the previous download completed time in local timelogger.echo("Checkpoint found")# The checkpoint's local storage profile id must match the CLI optionif local_storage_profile_id != checkpoint.local_storage_profile_id:if checkpoint.local_storage_profile_id is None:raise DeadlineOperationError("The checkpoint was created with the --ignore-storage-profiles, you must use the same option to continue from it.")if local_storage_profile_id is None:raise DeadlineOperationError("The checkpoint was created without the --ignore-storage-profiles, you must leave out the option to continue from it.")raise DeadlineOperationError(f"The checkpoint was created with local storage profile {checkpoint.local_storage_profile_id}, but the configured storage profile is {local_storage_profile_id}")logger.echo(f"Continuing from: {checkpoint.downloads_completed_timestamp.astimezone().isoformat()}")logger.echo()updated_download_state: IncrementalDownloadState = _incremental_output_download(boto3_session=boto3_session,farm_id=farm_id,queue=queue,checkpoint=checkpoint,file_conflict_resolution=FileConflictResolution[conflict_resolution],config=config,print_function_callback=logger.echo,dry_run=dry_run,)# Save the checkpoint file if it's not a dry runif not dry_run:updated_download_state.save_file(checkpoint_file_path)logger.echo("Checkpoint saved")else:logger.echo("This is a DRY RUN so the checkpoint was not saved")
19
136
8
623
10
275
461
275
json,bootstrap_lookback_minutes,checkpoint_dir,force_bootstrap,ignore_storage_profiles,conflict_resolution,dry_run,**args
['queue', 'local_storage_profile_id', 'checkpoint_dir', 'checkpoint', 'local_storage_profile', 'farm_id', 'bootstrap_timestamp', 'deadline', 'id_source', 'queue_id']
None
{"AnnAssign": 8, "Assign": 13, "Expr": 19, "For": 1, "If": 13, "Try": 1, "With": 1}
68
187
68
["DeadlineOperationError", "args.get", "click.UsageError", "ClickLogger", "os.path.abspath", "os.path.expanduser", "os.makedirs", "os.access", "DeadlineOperationError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_session", "get_session_client", "logger.echo", "config_file.get_setting", "DeadlineOperationError", "deadline.get_storage_profile_for_queue", "args.get", "DeadlineOperationError", "os.path.join", "deadline.get_queue", "DeadlineOperationError", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "os.path.join", "PidFileLock", "os.path.exists", "datetime.now", "timedelta", "IncrementalDownloadState", "logger.echo", "logger.echo", "logger.echo", "isoformat", "bootstrap_timestamp.astimezone", "IncrementalDownloadState.from_file", "logger.echo", "DeadlineOperationError", "DeadlineOperationError", "DeadlineOperationError", "logger.echo", "isoformat", "checkpoint.downloads_completed_timestamp.astimezone", "logger.echo", "_incremental_output_download", "updated_download_state.save_file", "logger.echo", "logger.echo", "cli_queue.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option", "api.record_success_fail_telemetry_event"]
0
[]
The function (sync_output) defined within the public class called public.The function start at line 275 and ends at 461. It contains 136 lines of code and it has a cyclomatic complexity of 19. It takes 8 parameters, represented as [275.0] and does not return any value. It declares 68.0 functions, and It has 68.0 functions called inside which are ["DeadlineOperationError", "args.get", "click.UsageError", "ClickLogger", "os.path.abspath", "os.path.expanduser", "os.makedirs", "os.access", "DeadlineOperationError", "_apply_cli_options_to_config", "config_file.get_setting", "config_file.get_setting", "api.get_boto3_session", "get_session_client", "logger.echo", "config_file.get_setting", "DeadlineOperationError", "deadline.get_storage_profile_for_queue", "args.get", "DeadlineOperationError", "os.path.join", "deadline.get_queue", "DeadlineOperationError", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "logger.echo", "os.path.join", "PidFileLock", "os.path.exists", "datetime.now", "timedelta", "IncrementalDownloadState", "logger.echo", "logger.echo", "logger.echo", "isoformat", "bootstrap_timestamp.astimezone", "IncrementalDownloadState.from_file", "logger.echo", "DeadlineOperationError", "DeadlineOperationError", "DeadlineOperationError", "logger.echo", "isoformat", "checkpoint.downloads_completed_timestamp.astimezone", "logger.echo", "_incremental_output_download", "updated_download_state.save_file", "logger.echo", "logger.echo", "cli_queue.command", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.option", "click.Choice", "click.option", "api.record_success_fail_telemetry_event"].
aws-deadline_deadline-cloud
public
public
0
0
cli_worker
def cli_worker():"""Commands to work with workers."""
1
1
0
5
0
19
22
19
[]
None
{"Expr": 1}
1
4
1
["main.group"]
0
[]
The function (cli_worker) defined within the public class called public.The function start at line 19 and ends at 22. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called inside which is ["main.group"].
aws-deadline_deadline-cloud
public
public
0
0
worker_list
def worker_list(page_size, item_offset, fleet_id, **args):"""Lists the Workers in a fleet."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)deadline = api.get_boto3_client("deadline", config=config)try:response = deadline.search_workers(farmId=farm_id, fleetIds=[fleet_id], itemOffset=item_offset, pageSize=page_size)except ClientError as exc:raise DeadlineOperationError(f"Failed to get Workers from Deadline:\n{exc}") from exctotal_results = response["totalResults"]# Select which fields to print and in which orderstructured_worker_list = [{field: worker[field] for field in ["workerId", "status", "createdAt"]}for worker in response["workers"]]click.echo(f"Displaying {len(structured_worker_list)} of {total_results} workers starting at {item_offset}")click.echo()click.echo(_cli_object_repr(structured_worker_list))
4
20
4
145
6
32
61
32
page_size,item_offset,fleet_id,**args
['config', 'farm_id', 'deadline', 'response', 'total_results', 'structured_worker_list']
None
{"Assign": 6, "Expr": 4, "Try": 1}
16
30
16
["_apply_cli_options_to_config", "config_file.get_setting", "api.get_boto3_client", "deadline.search_workers", "DeadlineOperationError", "click.echo", "len", "click.echo", "click.echo", "_cli_object_repr", "cli_worker.command", "click.option", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (worker_list) defined within the public class called public.The function start at line 32 and ends at 61. It contains 20 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [32.0] and does not return any value. It declares 16.0 functions, and It has 16.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "api.get_boto3_client", "deadline.search_workers", "DeadlineOperationError", "click.echo", "len", "click.echo", "click.echo", "_cli_object_repr", "cli_worker.command", "click.option", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
worker_get
def worker_get(fleet_id, worker_id, **args):"""Get the details of a worker."""# Get a temporary config object with the standard options handledconfig = _apply_cli_options_to_config(required_options={"farm_id"}, **args)farm_id = config_file.get_setting("defaults.farm_id", config=config)deadline = api.get_boto3_client("deadline", config=config)response = deadline.get_worker(farmId=farm_id, fleetId=fleet_id, workerId=worker_id)response.pop("ResponseMetadata", None)click.echo(_cli_object_repr(response))
1
7
3
83
4
70
83
70
fleet_id,worker_id,**args
['farm_id', 'config', 'deadline', 'response']
None
{"Assign": 4, "Expr": 3}
12
14
12
["_apply_cli_options_to_config", "config_file.get_setting", "api.get_boto3_client", "deadline.get_worker", "response.pop", "click.echo", "_cli_object_repr", "cli_worker.command", "click.option", "click.option", "click.option", "click.option"]
0
[]
The function (worker_get) defined within the public class called public.The function start at line 70 and ends at 83. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [70.0] and does not return any value. It declares 12.0 functions, and It has 12.0 functions called inside which are ["_apply_cli_options_to_config", "config_file.get_setting", "api.get_boto3_client", "deadline.get_worker", "response.pop", "click.echo", "_cli_object_repr", "cli_worker.command", "click.option", "click.option", "click.option", "click.option"].
aws-deadline_deadline-cloud
public
public
0
0
get_config_file_path
def get_config_file_path() -> Path:"""Get the config file path from the environment variable, falling backto our default if it is not set."""return Path(os.environ.get(CONFIG_FILE_PATH_ENV_VAR) or CONFIG_FILE_PATH).expanduser()
2
2
0
25
0
147
152
147
[]
Path
{"Expr": 1, "Return": 1}
3
6
3
["expanduser", "Path", "os.environ.get"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.read_config", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.write_config"]
The function (get_config_file_path) defined within the public class called public.The function start at line 147 and ends at 152. It contains 2 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 inside which are ["expanduser", "Path", "os.environ.get"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.read_config", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.write_config"].
aws-deadline_deadline-cloud
public
public
0
0
get_cache_directory
def get_cache_directory() -> str:"""Get the cache directory."""return os.path.expanduser(DEFAULT_CACHE_DIR)
1
2
0
16
0
155
159
155
[]
str
{"Expr": 1, "Return": 1}
1
5
1
["os.path.expanduser"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.examples.submit_job_py.process_job_attachments"]
The function (get_cache_directory) defined within the public class called public.The function start at line 155 and ends at 159. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside which is ["os.path.expanduser"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.examples.submit_job_py.process_job_attachments"].
aws-deadline_deadline-cloud
public
public
0
0
_should_read_config
def _should_read_config(config_file_path: Path) -> bool:global __config_file_pathglobal __config_mtimeif (__config_mtime is not Noneand config_file_path == __config_file_pathand config_file_path.is_file()):mtime = config_file_path.stat().st_mtimeif mtime == __config_mtime:return Falsereturn True
5
12
1
49
1
162
174
162
config_file_path
['mtime']
bool
{"Assign": 1, "If": 2, "Return": 2}
2
13
2
["config_file_path.is_file", "config_file_path.stat"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.read_config"]
The function (_should_read_config) defined within the public class called public.The function start at line 162 and ends at 174. It contains 12 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 2.0 functions, It has 2.0 functions called inside which are ["config_file_path.is_file", "config_file_path.stat"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.read_config"].
aws-deadline_deadline-cloud
public
public
0
0
read_config
def read_config() -> ConfigParser:"""If the config hasn't been read yet, or was modified since it was lastread, reads the AWS Deadline Cloud configuration."""global __configglobal __config_file_pathglobal __config_mtimeconfig_file_path = get_config_file_path()if _should_read_config(config_file_path):# Read the config file with a fresh config parser, and update the last-modified time stamp__config = ConfigParser()__config_file_path = config_file_pathtry:with open(config_file_path, mode="r", encoding="utf-8") as fh:config_contents = fh.read()__config.read_string(config_contents, str(config_file_path))except FileNotFoundError:# If the config file doesn't exist, leave an empty ConfigParser() object, in all# other cases let the error pass through.passif config_file_path.is_file():__config_mtime = config_file_path.stat().st_mtimeelse:__config_mtime = Nonereturn __config
4
19
0
95
5
177
205
177
['config_file_path', '__config', '__config_file_path', '__config_mtime', 'config_contents']
ConfigParser
{"Assign": 6, "Expr": 2, "If": 2, "Return": 1, "Try": 1, "With": 1}
9
29
9
["get_config_file_path", "_should_read_config", "ConfigParser", "open", "fh.read", "__config.read_string", "str", "config_file_path.is_file", "config_file_path.stat"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_best_profile_for_farm", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"]
The function (read_config) defined within the public class called public.The function start at line 177 and ends at 205. It contains 19 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 9.0 functions, It has 9.0 functions called inside which are ["get_config_file_path", "_should_read_config", "ConfigParser", "open", "fh.read", "__config.read_string", "str", "config_file_path.is_file", "config_file_path.stat"], It has 3.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_best_profile_for_farm", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"].
aws-deadline_deadline-cloud
public
public
0
0
_reset_directory_permissions_windows
def _reset_directory_permissions_windows(directory: Path) -> None:if platform.system() != "Windows":returnimport win32securityimport ntsecuritycon# We don't want to propagate existing permissions, so create a new DACLdacl = win32security.ACL()# On Windows, both SYSTEM and the Administrators group normally# have Full Access to files in the user's home directory.# Use SIDs to represent the Administrators and SYSTEM to# support multi-language operating systems# Administrator(S-1-5-32-544), SYSTEM(S-1-5-18)# https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sidssystem_sid = win32security.ConvertStringSidToSid("S-1-5-18")admin_sid = win32security.ConvertStringSidToSid("S-1-5-32-544")username = getpass.getuser()user_sid, _, _ = win32security.LookupAccountName(None, username)for sid in [user_sid, admin_sid, system_sid]:dacl.AddAccessAllowedAceEx(win32security.ACL_REVISION,ntsecuritycon.OBJECT_INHERIT_ACE | ntsecuritycon.CONTAINER_INHERIT_ACE,ntsecuritycon.GENERIC_ALL,sid,)# Get the security descriptor of the objectsd = win32security.GetFileSecurity(str(directory.resolve()), win32security.DACL_SECURITY_INFORMATION)# Set the security descriptor's DACL to the newly-created DACL# Arguments:# 1. bDaclPresent = 1: Indicates that the DACL is present in the security descriptor.#If set to 0, this method ignores the provided DACL and allows access to all principals.# 2. dacl: The discretionary access control list (DACL) to be set in the security descriptor.# 3. bDaclDefaulted = 0: Indicates the DACL was provided and not defaulted.#If set to 1, indicates the DACL was defaulted, as in the case of permissions inherited from a parent directory.sd.SetSecurityDescriptorDacl(1, dacl, 0)win32security.SetFileSecurity(str(directory.resolve()), win32security.DACL_SECURITY_INFORMATION, sd)
3
24
1
149
5
208
252
208
directory
['dacl', 'admin_sid', 'sd', 'username', 'system_sid']
None
{"Assign": 6, "Expr": 3, "For": 1, "If": 1, "Return": 1}
14
45
14
["platform.system", "win32security.ACL", "win32security.ConvertStringSidToSid", "win32security.ConvertStringSidToSid", "getpass.getuser", "win32security.LookupAccountName", "dacl.AddAccessAllowedAceEx", "win32security.GetFileSecurity", "str", "directory.resolve", "sd.SetSecurityDescriptorDacl", "win32security.SetFileSecurity", "str", "directory.resolve"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.write_config"]
The function (_reset_directory_permissions_windows) defined within the public class called public.The function start at line 208 and ends at 252. It contains 24 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 14.0 functions, It has 14.0 functions called inside which are ["platform.system", "win32security.ACL", "win32security.ConvertStringSidToSid", "win32security.ConvertStringSidToSid", "getpass.getuser", "win32security.LookupAccountName", "dacl.AddAccessAllowedAceEx", "win32security.GetFileSecurity", "str", "directory.resolve", "sd.SetSecurityDescriptorDacl", "win32security.SetFileSecurity", "str", "directory.resolve"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.write_config"].
aws-deadline_deadline-cloud
public
public
0
0
write_config
def write_config(config: ConfigParser) -> None:"""Writes the provided config to the AWS Deadline Cloud configuration.Args:config (ConfigParser): The config object to write. Generally this isa modified value from what `read_config` returns."""config_file_path = get_config_file_path()if not config_file_path.parent.exists():config_file_path.parent.mkdir(parents=True, exist_ok=True)if platform.system() == "Windows":_reset_directory_permissions_windows(config_file_path.parent)# Using the config file path as the prefix ensures that the tmpfile and real file are# on the same filesystem. This is a requirement for os.replace to be atomic.file_descriptor, tmp_file_name = tempfile.mkstemp(prefix=str(config_file_path), text=True)# Note: The file descriptor is closed when exiting the context manager.with os.fdopen(file_descriptor, "w", encoding="utf8") as configfile:config.write(configfile)os.replace(tmp_file_name, config_file_path)
3
10
1
103
1
255
277
255
config
['config_file_path']
None
{"Assign": 2, "Expr": 5, "If": 2, "With": 1}
10
23
10
["get_config_file_path", "config_file_path.parent.exists", "config_file_path.parent.mkdir", "platform.system", "_reset_directory_permissions_windows", "tempfile.mkstemp", "str", "os.fdopen", "config.write", "os.replace"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"]
The function (write_config) defined within the public class called public.The function start at line 255 and ends at 277. It contains 10 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 10.0 functions, It has 10.0 functions called inside which are ["get_config_file_path", "config_file_path.parent.exists", "config_file_path.parent.mkdir", "platform.system", "_reset_directory_permissions_windows", "tempfile.mkstemp", "str", "os.fdopen", "config.write", "os.replace"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"].
aws-deadline_deadline-cloud
public
public
0
0
_get_setting_config
def _get_setting_config(setting_name: str) -> dict:"""Gets the setting configuration for the specified setting name,raising an error if it does not exist.Args:setting_name (str): The full setting name, like `section.setting`."""setting_config = SETTINGS.get(setting_name)if not setting_config:raise DeadlineOperationError(f"AWS Deadline Cloud configuration has no setting named {setting_name!r}.")return setting_config
2
7
1
30
1
280
293
280
setting_name
['setting_config']
dict
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
2
14
2
["SETTINGS.get", "DeadlineOperationError"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting_default", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"]
The function (_get_setting_config) defined within the public class called public.The function start at line 280 and ends at 293. 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 2.0 functions, It has 2.0 functions called inside which are ["SETTINGS.get", "DeadlineOperationError"], It has 3.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting_default", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"].
aws-deadline_deadline-cloud
public
public
0
0
_get_default_from_setting_config
def _get_default_from_setting_config(setting_config, config: Optional[ConfigParser]) -> str:"""Gets the default value from a setting_config entry, performing value substitutions.Currently the only substitution supported is `{aws_profile_name}`."""default_value = setting_config["default"]# Only do the substitution if we see a patternif "{" in default_value:default_value = default_value.format(aws_profile_name=get_setting("defaults.aws_profile_name", config=config))return default_value
2
7
2
45
1
296
308
296
setting_config,config
['default_value']
str
{"Assign": 2, "Expr": 1, "If": 1, "Return": 1}
2
13
2
["default_value.format", "get_setting"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py._get_section_prefixes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting_default"]
The function (_get_default_from_setting_config) defined within the public class called public.The function start at line 296 and ends at 308. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [296.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside which are ["default_value.format", "get_setting"], It has 3.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py._get_section_prefixes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting_default"].
aws-deadline_deadline-cloud
public
public
0
0
get_setting_default
def get_setting_default(setting_name: str, config: Optional[ConfigParser] = None) -> str:"""Gets the default value for the setting `setting_name`.Raises an exception if the setting does not exist.Args:setting_name (str): The full setting name, like `section.setting`.config: The config file read with `read_config()`."""setting_config = _get_setting_config(setting_name)return _get_default_from_setting_config(setting_config, config=config)
1
3
2
34
1
311
321
311
setting_name,config
['setting_config']
str
{"Assign": 1, "Expr": 1, "Return": 1}
2
11
2
["_get_setting_config", "_get_default_from_setting_config"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._main_py._get_default_log_level", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.clear_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting_with_tooltips"]
The function (get_setting_default) defined within the public class called public.The function start at line 311 and ends at 321. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [311.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside which are ["_get_setting_config", "_get_default_from_setting_config"], It has 4.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._main_py._get_default_log_level", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.clear_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting_with_tooltips"].
aws-deadline_deadline-cloud
public
public
0
0
_get_section_prefixes
def _get_section_prefixes(setting_config: dict, config: ConfigParser) -> List[str]:"""Gets a list of the section name prefixes for the specified setting section + setting configArgs:setting_config: The setting config object from the SETTINGS dictionary.config: The config file read with `read_config()`."""if "depend" in setting_config:dep_setting_name = setting_config["depend"]dep_setting_config = SETTINGS[dep_setting_name]dep_section_format = dep_setting_config["section_format"]dep_section, dep_name = dep_setting_name.split(".", 1)dep_section_prefixes = _get_section_prefixes(dep_setting_config, config)dep_section_value: Optional[str] = config.get(" ".join(dep_section_prefixes + [dep_section]), dep_name, fallback=None)if dep_section_value is None:dep_section_value = _get_default_from_setting_config(dep_setting_config, config=config)formatted_section_value = dep_section_format.format(dep_section_value)return dep_section_prefixes + [formatted_section_value]else:return []
3
16
2
122
6
324
347
324
setting_config,config
['dep_section_format', 'dep_setting_name', 'dep_setting_config', 'formatted_section_value', 'dep_section_prefixes', 'dep_section_value']
List[str]
{"AnnAssign": 1, "Assign": 7, "Expr": 1, "If": 2, "Return": 2}
6
24
6
["dep_setting_name.split", "_get_section_prefixes", "config.get", "join", "_get_default_from_setting_config", "dep_section_format.format"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py._get_section_prefixes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"]
The function (_get_section_prefixes) defined within the public class called public.The function start at line 324 and ends at 347. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [324.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions called inside which are ["dep_setting_name.split", "_get_section_prefixes", "config.get", "join", "_get_default_from_setting_config", "dep_section_format.format"], It has 3.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py._get_section_prefixes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.set_setting"].
aws-deadline_deadline-cloud
public
public
0
0
get_setting
def get_setting(setting_name: str, config: Optional[ConfigParser] = None) -> str:"""Gets the value of the specified setting, returning the default ifnot configured. Raises an exception if the setting does not exist.Args:setting_name (str): The full setting name, like `section.setting`.config (ConfigParser, optional): The config file read with `read_config()`."""if "." not in setting_name:raise DeadlineOperationError(f"The setting name {setting_name!r} is not valid.")section, name = setting_name.split(".", 1)if config is None:config = read_config()setting_config = _get_setting_config(setting_name)section_prefixes = _get_section_prefixes(setting_config, config)section = " ".join(section_prefixes + [section])result: Optional[str] = config.get(section, name, fallback=None)if result is None:return _get_default_from_setting_config(setting_config, config=config)else:return result
4
14
2
116
4
350
376
350
setting_name,config
['section_prefixes', 'config', 'section', 'setting_config']
str
{"AnnAssign": 1, "Assign": 5, "Expr": 1, "If": 3, "Return": 2}
8
27
8
["DeadlineOperationError", "setting_name.split", "read_config", "_get_setting_config", "_get_section_prefixes", "join", "config.get", "_get_default_from_setting_config"]
26
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCompareCommand.is_enabled", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCompareCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCompareCommand.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCopyRelativePathCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarEditCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._loginout_py._login_deadline_cloud_monitor", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._loginout_py.logout", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._session_py.get_boto3_session", "_.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.client.api._session_py.precache_clients", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.auth_group_py.auth_status", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._main_py._get_default_log_level", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli.deadline_dev_gui_main_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py._get_default_from_setting_config", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_best_profile_for_farm", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.__init___py.create_job_history_bundle_dir", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog._set_submit_button_state", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.DeadlineFarmDisplay.get_item", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.DeadlineQueueDisplay.get_item", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.DeadlineStorageProfileNameDisplay.get_item", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.SharedJobSettingsWidget._start_load_queue_parameters_thread", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.SharedJobSettingsWidget.refresh_queue_parameters", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py._DeadlineNamedResourceDisplay.__init__"]
The function (get_setting) defined within the public class called public.The function start at line 350 and ends at 376. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [350.0] and does not return any value. It declares 8.0 functions, It has 8.0 functions called inside which are ["DeadlineOperationError", "setting_name.split", "read_config", "_get_setting_config", "_get_section_prefixes", "join", "config.get", "_get_default_from_setting_config"], It has 26.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCompareCommand.is_enabled", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCompareCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCompareCommand.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarCopyRelativePathCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3667502_braver_sidebartools.SideBar_py.SideBarEditCommand.is_visible", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._loginout_py._login_deadline_cloud_monitor", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._loginout_py.logout", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._session_py.get_boto3_session", "_.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.client.api._session_py.precache_clients", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.auth_group_py.auth_status", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._main_py._get_default_log_level", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli.deadline_dev_gui_main_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py._get_default_from_setting_config", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_best_profile_for_farm", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.__init___py.create_job_history_bundle_dir", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog._set_submit_button_state", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.DeadlineFarmDisplay.get_item", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.DeadlineQueueDisplay.get_item", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.DeadlineStorageProfileNameDisplay.get_item", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.SharedJobSettingsWidget._start_load_queue_parameters_thread", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py.SharedJobSettingsWidget.refresh_queue_parameters", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.shared_job_settings_tab_py._DeadlineNamedResourceDisplay.__init__"].
aws-deadline_deadline-cloud
public
public
0
0
set_setting
def set_setting(setting_name: str, value: str, config: Optional[ConfigParser] = None):"""Sets the value of the specified setting, returning the default ifnot configured. Raises an exception if the setting does not exist.Args:setting_name (str): The full setting name, like `section.setting`.value (bool|int|float|str): The value to set.config (Optional[ConfigParser]): If provided sets the setting in the parser and does not save to disk."""if "." not in setting_name:raise DeadlineOperationError(f"The setting name {setting_name!r} is not valid.")section, name = setting_name.split(".", 1)# Get the type of the default to validate it is an AWS Deadline Cloud setting, and retrieve its typesetting_config = _get_setting_config(setting_name)# If no config was provided, then read from disk and signal to write it laterif not config:config = read_config()save_config = Trueelse:save_config = Falsesection_prefixes = _get_section_prefixes(setting_config, config)section = " ".join(section_prefixes + [section])if section not in config:config[section] = {}config.set(section, name, value)if save_config:write_config(config)
5
17
3
118
5
379
409
379
setting_name,value,config
['config', 'save_config', 'section', 'setting_config', 'section_prefixes']
None
{"Assign": 8, "Expr": 3, "If": 4}
8
31
8
["DeadlineOperationError", "setting_name.split", "_get_setting_config", "read_config", "_get_section_prefixes", "join", "config.set", "write_config"]
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.clear_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_best_profile_for_farm", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_progress_dialog_py._JobSumissionWarningDialog.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog._submission_succeeded_signal_receiver", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_handle_web_url_py.test_cli_handle_web_url_download_output_only_required_input", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_handle_web_url_py.test_cli_handle_web_url_download_output_with_optional_input"]
The function (set_setting) defined within the public class called public.The function start at line 379 and ends at 409. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [379.0] and does not return any value. It declares 8.0 functions, It has 8.0 functions called inside which are ["DeadlineOperationError", "setting_name.split", "_get_setting_config", "read_config", "_get_section_prefixes", "join", "config.set", "write_config"], It has 7.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.clear_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.config.config_file_py.get_best_profile_for_farm", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_progress_dialog_py._JobSumissionWarningDialog.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog._submission_succeeded_signal_receiver", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_handle_web_url_py.test_cli_handle_web_url_download_output_only_required_input", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_handle_web_url_py.test_cli_handle_web_url_download_output_with_optional_input"].
aws-deadline_deadline-cloud
public
public
0
0
clear_setting
def clear_setting(setting_name: str, config: Optional[ConfigParser] = None):"""Sets the value of the specified setting back to the default value.Args:setting_name (str): The full setting name, like `section.setting`.config (Optional[ConfigParser]): If provided clears the setting in the parser and does not save to disk."""if "." not in setting_name:raise DeadlineOperationError(f"The setting name {setting_name!r} is not valid.")set_setting(setting_name, get_setting_default(setting_name, config=config), config=config)
2
4
2
46
0
412
423
412
setting_name,config
[]
None
{"Expr": 2, "If": 1}
3
12
3
["DeadlineOperationError", "set_setting", "get_setting_default"]
0
[]
The function (clear_setting) defined within the public class called public.The function start at line 412 and ends at 423. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [412.0] and does not return any value. It declares 3.0 functions, and It has 3.0 functions called inside which are ["DeadlineOperationError", "set_setting", "get_setting_default"].
aws-deadline_deadline-cloud
public
public
0
0
get_best_profile_for_farm
def get_best_profile_for_farm(farm_id: str, queue_id: Optional[str] = None) -> str:"""Finds the best AWS profile for the specified farm and queue IDs. Choosesthe first match from:1. The default AWS profile if its default farm matches.2. AWS profiles whose default farm and queue IDs match.3. AWS profiles whose default farm matches.4. If there were no matches, returns the default AWS profile."""# Get the full list of AWS profilessession = boto3.Session()aws_profile_names = session._session.full_config["profiles"].keys()# Make a deep copy of the return from read_config(), since we modify# it during the profile name search.config = ConfigParser()config.read_dict(read_config())# (For 1.) Save the default profile and return it if its default farm matches.default_aws_profile_name: str = str(get_setting("defaults.aws_profile_name", config=config))if get_setting("defaults.farm_id", config=config) == farm_id:return default_aws_profile_name# (For 3.) We'll accumulate the profiles whose farms matched herefirst_farm_aws_profile_name: Optional[str] = None# (For 2.) Search for a profile with both a farm and queue matchfor aws_profile_name in aws_profile_names:set_setting("defaults.aws_profile_name", aws_profile_name, config=config)if get_setting("defaults.farm_id", config=config) == farm_id:# Return if both matchedif queue_id and get_setting("defaults.queue_id", config=config) == queue_id:return aws_profile_name# Save if this was the first time the farm matchedif not first_farm_aws_profile_name:first_farm_aws_profile_name = aws_profile_name# Return the first farm-matched profile, or the default if there was nonereturn first_farm_aws_profile_name or default_aws_profile_name
8
17
2
144
4
426
464
426
farm_id,queue_id
['aws_profile_names', 'config', 'first_farm_aws_profile_name', 'session']
str
{"AnnAssign": 2, "Assign": 4, "Expr": 3, "For": 1, "If": 4, "Return": 3}
11
39
11
["boto3.Session", "keys", "ConfigParser", "config.read_dict", "read_config", "str", "get_setting", "get_setting", "set_setting", "get_setting", "get_setting"]
0
[]
The function (get_best_profile_for_farm) defined within the public class called public.The function start at line 426 and ends at 464. It contains 17 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [426.0] and does not return any value. It declares 11.0 functions, and It has 11.0 functions called inside which are ["boto3.Session", "keys", "ConfigParser", "config.read_dict", "read_config", "str", "get_setting", "get_setting", "set_setting", "get_setting", "get_setting"].
aws-deadline_deadline-cloud
public
public
0
0
str2bool
def str2bool(value: str) -> bool:"""Converts a string to boolean, accepting a variety of on/off,true/false, 0/1 variants."""value = value.lower()if value in _BOOL_VALUES:return value in _TRUE_VALUESelse:raise ValueError(f"{value!r} is not a valid boolean string value")
2
6
1
34
1
467
476
467
value
['value']
bool
{"Assign": 1, "Expr": 1, "If": 1, "Return": 1}
2
10
2
["value.lower", "ValueError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_checkbox_setting"]
The function (str2bool) defined within the public class called public.The function start at line 467 and ends at 476. 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. It declares 2.0 functions, It has 2.0 functions called inside which are ["value.lower", "ValueError"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_checkbox_setting"].
aws-deadline_deadline-cloud
public
public
0
0
create_job_history_bundle_dir
def create_job_history_bundle_dir(submitter_name: str, job_name: str) -> str:"""Creates a new directory in the configured directorysettings.job_history_dir, in which to place a newjob bundle for submission.The directory will look like<job_history_dir>/YYYY-mm/YYYY-mm-ddTHH-##-<submitter_name>-<job_name>"""job_history_dir = str(get_setting("settings.job_history_dir"))job_history_dir = os.path.expanduser(job_history_dir)# Clean the submitter_name's characterssubmitter_name_cleaned = "".join(char for char in submitter_name if char.isalnum() or char in " -_")# Clean the job_name's characters and truncate for the filenamejob_name_cleaned = "".join(char for char in job_name if char.isalnum() or char in " -_")job_name_cleaned = job_name_cleaned[:128]timestamp = datetime.datetime.now()month_tag = timestamp.strftime("%Y-%m")date_tag = timestamp.strftime("%Y-%m-%d")month_dir = os.path.join(job_history_dir, month_tag)if not os.path.isdir(month_dir):os.makedirs(month_dir)# Index the files so they sort in order of submissionnumber = 1existing_dirs = sorted(glob.glob(os.path.join(month_dir, f"{date_tag}-*")))if existing_dirs:latest_dir = existing_dirs[-1]number = int(os.path.basename(latest_dir)[len(date_tag) + 1 :].split("-", 1)[0]) + 1result = os.path.join(month_dir, f"{date_tag}-{number:02}-{submitter_name_cleaned}-{job_name_cleaned}")os.makedirs(result)return result
9
24
2
227
11
20
60
20
submitter_name,job_name
['timestamp', 'submitter_name_cleaned', 'job_name_cleaned', 'month_tag', 'month_dir', 'latest_dir', 'existing_dirs', 'job_history_dir', 'date_tag', 'result', 'number']
str
{"Assign": 14, "Expr": 3, "If": 2, "Return": 1}
22
41
22
["str", "get_setting", "os.path.expanduser", "join", "char.isalnum", "join", "char.isalnum", "datetime.datetime.now", "timestamp.strftime", "timestamp.strftime", "os.path.join", "os.path.isdir", "os.makedirs", "sorted", "glob.glob", "os.path.join", "int", "split", "os.path.basename", "len", "os.path.join", "os.makedirs"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_export_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_submit"]
The function (create_job_history_bundle_dir) defined within the public class called public.The function start at line 20 and ends at 60. It contains 24 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [20.0] and does not return any value. It declares 22.0 functions, It has 22.0 functions called inside which are ["str", "get_setting", "os.path.expanduser", "join", "char.isalnum", "join", "char.isalnum", "datetime.datetime.now", "timestamp.strftime", "timestamp.strftime", "os.path.join", "os.path.isdir", "os.makedirs", "sorted", "glob.glob", "os.path.join", "int", "split", "os.path.basename", "len", "os.path.join", "os.makedirs"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_export_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_submit"].
aws-deadline_deadline-cloud
DeadlineRepresenter
public
0
1
represent_str
def represent_str(self, data):if "\n" in data:return self.represent_scalar("tag:yaml.org,2002:str", data, style="|")else:return self.represent_scalar("tag:yaml.org,2002:str", data)
2
5
2
36
0
21
25
21
self,data
[]
Returns
{"If": 1, "Return": 2}
2
5
2
["self.represent_scalar", "self.represent_scalar"]
0
[]
The function (represent_str) defined within the public class called DeadlineRepresenter, that inherit another class.The function start at line 21 and ends at 25. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [21.0], and this function return a value. It declares 2.0 functions, and It has 2.0 functions called inside which are ["self.represent_scalar", "self.represent_scalar"].
aws-deadline_deadline-cloud
DeadlineDumper
public
0
1
__init__
def __init__(self,stream,default_style=None,default_flow_style=False,canonical=None,indent=None,width=None,allow_unicode=None,line_break=None,encoding=None,explicit_start=None,explicit_end=None,version=None,tags=None,sort_keys=True,):Emitter.__init__(self,stream,canonical=canonical,indent=indent,width=width,allow_unicode=allow_unicode,line_break=line_break,)Serializer.__init__(self,encoding=encoding,explicit_start=explicit_start,explicit_end=explicit_end,version=version,tags=tags,)DeadlineRepresenter.__init__(# type: ignore[call-arg]self,default_style=default_style,default_flow_style=default_flow_style,sort_keys=sort_keys,)Resolver.__init__(self)
1
41
15
141
0
32
72
32
self,stream,default_style,default_flow_style,canonical,indent,width,allow_unicode,line_break,encoding,explicit_start,explicit_end,version,tags,sort_keys
[]
None
{"Expr": 4}
4
41
4
["Emitter.__init__", "Serializer.__init__", "DeadlineRepresenter.__init__", "Resolver.__init__"]
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_py.TgScheduler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.CalculatedAmountDiscrepancyError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ExchangeRateMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.InvalidTransactionError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ParsingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.PriceMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.QuantityNotPositiveError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.SymbolMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedColumnCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedRowCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.raw_py.RawTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.trading212_py.Trading212Transaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.vanguard_py.VanguardTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.ExporterError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordFileDoesNotExistError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordTooLongError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.DeviceInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HomeAutomation.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostNumberOfEntries.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.LanInterfaceConfig.__init__"]
The function (__init__) defined within the public class called DeadlineDumper, that inherit another class.The function start at line 32 and ends at 72. It contains 41 lines of code and it has a cyclomatic complexity of 1. It takes 15 parameters, represented as [32.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside which are ["Emitter.__init__", "Serializer.__init__", "DeadlineRepresenter.__init__", "Resolver.__init__"], It has 4993.0 functions calling this function which are ["_.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_py.TgScheduler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.CalculatedAmountDiscrepancyError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ExchangeRateMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.InvalidTransactionError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ParsingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.PriceMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.QuantityNotPositiveError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.SymbolMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedColumnCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedRowCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.raw_py.RawTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.trading212_py.Trading212Transaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.vanguard_py.VanguardTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.ExporterError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordFileDoesNotExistError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordTooLongError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.DeviceInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HomeAutomation.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostNumberOfEntries.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.LanInterfaceConfig.__init__"].
aws-deadline_deadline-cloud
public
public
0
0
deadline_yaml_dump
def deadline_yaml_dump(data, stream=None, **kwds) -> str:"""Works like pyyaml's safe_dump, but saves multi-linestrings with the "|" style and defaults to sort_keys=False."""return yaml.dump_all([data], stream, Dumper=DeadlineDumper, sort_keys=False, **kwds)
1
2
3
37
0
75
80
75
data,stream,**kwds
[]
str
{"Expr": 1, "Return": 1}
1
6
1
["yaml.dump_all"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._common_py._cli_object_repr", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.saver_py.save_yaml_or_json_to_file", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.show_cli_job_submitter"]
The function (deadline_yaml_dump) defined within the public class called public.The function start at line 75 and ends at 80. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [75.0] and does not return any value. It declare 1.0 function, It has 1.0 function called inside which is ["yaml.dump_all"], It has 4.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._common_py._cli_object_repr", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.saver_py.save_yaml_or_json_to_file", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.show_cli_job_submitter"].
aws-deadline_deadline-cloud
public
public
0
0
parse_frame_range
def parse_frame_range(frame_string: str) -> list[int]:framelist_re = re.compile(r"^(?P<start>-?\d+)(-(?P<stop>-?\d+)(:(?P<step>-?\d+))?)?$")match = framelist_re.match(frame_string)if not match:raise ValueError("Framelist not valid")start = int(match.group("start"))stop = int(match.group("stop")) if match.group("stop") is not None else startframe_step = (int(match.group("step")) if match.group("step") is not None else 1 if start < stop else -1)if frame_step == 0:raise ValueError("Frame step cannot be zero")if start > stop and frame_step > 0:raise ValueError("Start frame must be less than stop frame if step is positive")if start < stop and frame_step < 0:raise ValueError("Start frame must be greater than stop frame if step is negative")return list(range(start, stop + (1 if frame_step > 0 else -1), frame_step))
11
17
1
165
5
7
26
7
frame_string
['start', 'framelist_re', 'frame_step', 'match', 'stop']
list[int]
{"Assign": 5, "If": 4, "Return": 1}
16
20
16
["re.compile", "framelist_re.match", "ValueError", "int", "match.group", "match.group", "int", "match.group", "match.group", "int", "match.group", "ValueError", "ValueError", "ValueError", "list", "range"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_adaptors_py.test_parse_frame_range"]
The function (parse_frame_range) defined within the public class called public.The function start at line 7 and ends at 26. It contains 17 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value. It declares 16.0 functions, It has 16.0 functions called inside which are ["re.compile", "framelist_re.match", "ValueError", "int", "match.group", "match.group", "int", "match.group", "match.group", "int", "match.group", "ValueError", "ValueError", "ValueError", "list", "range"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_adaptors_py.test_parse_frame_range"].
aws-deadline_deadline-cloud
public
public
0
0
validate_directory_symlink_containment
def validate_directory_symlink_containment(job_bundle_dir: str) -> None:"""Validates the integrity of the job bundle, validating that all filescontained in the job bundle resolve inside of the job bundle directory."""# The job bundle could itself be a symlink dirresolved_root = os.path.realpath(job_bundle_dir)if not os.path.isdir(resolved_root):raise DeadlineOperationError(f"Job bundle path provided is not a directory:\n{job_bundle_dir}")for root_dir, dir_names, file_names in os.walk(resolved_root):for path in chain(dir_names, file_names):norm_path = os.path.normpath(os.path.join(root_dir, path))resolved_path = os.path.realpath(norm_path)common_path = os.path.commonpath([resolved_root, resolved_path])if common_path != resolved_root:raise DeadlineOperationError(f"Job bundle cannot contain a path that resolves outside of the resolved bundle directory:\n{resolved_root}\n\nPath in bundle:\n{norm_path}\nResolves to:\n{resolved_path}")
5
15
1
115
4
22
41
22
job_bundle_dir
['resolved_path', 'norm_path', 'common_path', 'resolved_root']
None
{"Assign": 4, "Expr": 1, "For": 2, "If": 2}
10
20
10
["os.path.realpath", "os.path.isdir", "DeadlineOperationError", "os.walk", "chain", "os.path.normpath", "os.path.join", "os.path.realpath", "os.path.commonpath", "DeadlineOperationError"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_validate_directory_symlink_containment_fail", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_validate_directory_symlink_containment_success"]
The function (validate_directory_symlink_containment) defined within the public class called public.The function start at line 22 and ends at 41. It contains 15 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 10.0 functions, It has 10.0 functions called inside which are ["os.path.realpath", "os.path.isdir", "DeadlineOperationError", "os.walk", "chain", "os.path.normpath", "os.path.join", "os.path.realpath", "os.path.commonpath", "DeadlineOperationError"], It has 5.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_validate_directory_symlink_containment_fail", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_validate_directory_symlink_containment_success"].
aws-deadline_deadline-cloud
public
public
0
0
read_yaml_or_json
def read_yaml_or_json(job_bundle_dir: str, filename: str, required: bool) -> Tuple[str, str]:"""Checks whether {filename}.json or {filename}.yaml exist in the providedjob bundle directory, and returns a tuple (<file contents>, "YAML|JSON").Args:job_bundle_dir (str): The directory containing the job bundle.filename (str): The filename, without extension, to look for.required (bool): Whether this file is required. If not required and its missing, the function returns ("", "")."""path_prefix = os.path.join(job_bundle_dir, filename)has_json = os.path.isfile(path_prefix + ".json")has_yaml = os.path.isfile(path_prefix + ".yaml")if has_json and has_yaml:raise DeadlineOperationError(f"Job bundle directory has both {filename}.json and {filename}.yaml, only one is permitted:\n{job_bundle_dir}")elif has_json:with open(path_prefix + ".json", encoding="utf8") as f:return (f.read(), "JSON")elif has_yaml:with open(path_prefix + ".yaml", encoding="utf8") as f:return (f.read(), "YAML")else:if required:raise DeadlineOperationError(f"Job bundle directory lacks a {filename}.json or {filename}.yaml:\n{job_bundle_dir}")else:return ("", "")
6
21
3
143
3
44
74
44
job_bundle_dir,filename,required
['has_yaml', 'path_prefix', 'has_json']
Tuple[str, str]
{"Assign": 3, "Expr": 1, "If": 4, "Return": 3, "With": 2}
9
31
9
["os.path.join", "os.path.isfile", "os.path.isfile", "DeadlineOperationError", "open", "f.read", "open", "f.read", "DeadlineOperationError"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.loader_py.read_yaml_or_json_object", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"]
The function (read_yaml_or_json) defined within the public class called public.The function start at line 44 and ends at 74. It contains 21 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [44.0] and does not return any value. It declares 9.0 functions, It has 9.0 functions called inside which are ["os.path.join", "os.path.isfile", "os.path.isfile", "DeadlineOperationError", "open", "f.read", "open", "f.read", "DeadlineOperationError"], It has 3.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.loader_py.read_yaml_or_json_object", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"].
aws-deadline_deadline-cloud
public
public
0
0
parse_yaml_or_json_content
def parse_yaml_or_json_content(file_contents: str, file_type: str, bundle_dir: str, filename: str):"""Parses a yaml or json file that was read by the `read_yaml_or_json` function.Args:file_contents: The contents of the file that was read.file_type: The type of the filefilename: The filename that was read, without extension (for error messages).bundle_dir: The bundle directory the file was in (for error messages)."""if file_type == "JSON":try:return json.loads(file_contents)except json.JSONDecodeError as e:raise DeadlineOperationError(f"Error loading '{filename}.json':\n{e}")elif file_type == "YAML":try:return yaml.safe_load(file_contents)except yaml.MarkedYAMLError as e:raise DeadlineOperationError(f"Error loading '{filename}.yaml':\n{e}")else:raise RuntimeError(f"Unexpected file type '{file_type}' in job bundle:\n{bundle_dir}")
5
13
4
82
0
77
98
77
file_contents,file_type,bundle_dir,filename
[]
Returns
{"Expr": 1, "If": 2, "Return": 2, "Try": 2}
5
22
5
["json.loads", "DeadlineOperationError", "yaml.safe_load", "DeadlineOperationError", "RuntimeError"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.loader_py.read_yaml_or_json_object", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_parse_yaml_or_json_content_fail", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_parse_yaml_or_json_content_success"]
The function (parse_yaml_or_json_content) defined within the public class called public.The function start at line 77 and ends at 98. It contains 13 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [77.0], and this function return a value. It declares 5.0 functions, It has 5.0 functions called inside which are ["json.loads", "DeadlineOperationError", "yaml.safe_load", "DeadlineOperationError", "RuntimeError"], It has 5.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.loader_py.read_yaml_or_json_object", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_parse_yaml_or_json_content_fail", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_parse_yaml_or_json_content_success"].
aws-deadline_deadline-cloud
public
public
0
0
read_yaml_or_json_object
def read_yaml_or_json_object(bundle_dir: str, filename: str, required: bool) -> Optional[Dict[str, Any]]:"""Checks whether {filename}.json or {filename}.yaml exist in the providedjob bundle directory, and returns the file parsed into an object.Args:job_bundle_dir (str): The directory containing the job bundle.filename (str): The filename, without extension, to look for.required (bool): Whether this file is required. If not required and its missing, the function returns ("", "")."""file_contents, file_type = read_yaml_or_json(bundle_dir, filename, required)if file_contents and file_type:return parse_yaml_or_json_content(file_contents, file_type, bundle_dir, filename)else:return None
3
8
3
58
0
101
118
101
bundle_dir,filename,required
[]
Optional[Dict[str, Any]]
{"Assign": 1, "Expr": 1, "If": 1, "Return": 2}
2
18
2
["read_yaml_or_json", "parse_yaml_or_json_content"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.read_job_bundle_parameters", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle"]
The function (read_yaml_or_json_object) defined within the public class called public.The function start at line 101 and ends at 118. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [101.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside which are ["read_yaml_or_json", "parse_yaml_or_json_content"], It has 4.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.read_job_bundle_parameters", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle"].
aws-deadline_deadline-cloud
public
public
0
0
validate_job_parameter
def validate_job_parameter(input: Any,*,type_required: bool = False,default_required: bool = False,) -> JobParameter:"""Validates a job parameter as defined by Open Job Description. The validation allows for theunion of all possible fields but does not do per-type validation (e.g. minValue only allowedon parameters of type "INT" / "FLOAT")name: <Identifier>type: "PATH"description: <Description> # @optionaldefault: <JobParameterStringValue> # @optionalallowedValues: [ <JobParameterStringValue>, ... ] # @optionalminLength: <integer> # @optionalmaxLength: <integer> # @optionalminValue: <integer> | <intstr> | <float> | <floatstring> # @optionalmaxValue: <integer> | <intstr> | <float> | <floatstring> # @optionalobjectType: enum("FILE", "DIRECTORY") # @optionaldataFlow: enum("NONE", "IN", "OUT", "INOUT") # @optionaluserInterface: # @optional# ...Parameters----------input : AnyThe input to validatetype_required : bool = FalseWhether the "type" field is required. This is important for job bundles which may containapp-specific parameter values without accompanying metadata such as the parameter type.default_required : bool = FalseWhether the "default" field is required. In queue environments, defaults are required. Injob bundles, defaults are not required.Raises------ValueErrorThe input contains a non-valid valueTypeErrorThe input or one of its fields are not of the expected typeReturns-------JobParameterA type-cast version of the input. This is the same object reference to the input, but thedata has been validated."""if not isinstance(input, dict):raise TypeError(f"Expected a dict for job parameter, but got {type(input).__name__}")# Validate "name"if "name" not in input:raise ValueError(f'No "name" field in job parameter. Got {input}')name = input["name"]if not isinstance(name, str):raise TypeError(f'Job parameter had {type(name).__name__} for "name" but expected str')elif name == "":raise ValueError("Job parameter has an empty name")# Validate "description"if "description" in input:description = input["description"]if not isinstance(description, str):raise TypeError(f'Job parameter "{name}" had {type(description).__name__} for "description" but expected str')# Validate "type"if "type" in input:typ = input["type"]if typ not in _VALID_PARAMETER_TYPES:quoted = (f'"{valid_param_type}"' for valid_param_type in _VALID_PARAMETER_TYPES)raise ValueError(f'Job parameter "{name}" had "type" {typ} but expected one of ({", ".join(quoted)})')elif type_required:raise ValueError(f'Job parameter "{name}" is missing required key "type"')# Validate "default"if "default" in input:default = input["default"]if default is None:raise ValueError(f'Job parameter "{name}" had None for "default" but expected a value')elif default_required:raise ValueError(f'Job parameter "{name}" is missing required key "default"')if "allowedValues" in input:allowed_values = input["allowedValues"]if not isinstance(allowed_values, list):raise TypeError(f'Job parameter "{name}" got {type(allowed_values).__name__} for "allowedValues" but expected list')# Validate "dataFlow"if "dataFlow" in input:data_flow = input["dataFlow"]if data_flow not in ("NONE", "IN", "OUT", "INOUT"):raise ValueError(f'Job parameter "{name}" got "{data_flow}" for "dataFlow" but expected one of ("NONE", "IN", "OUT", "INOUT")')# Validate "minLength"if "minLength" in input:min_length = input["minLength"]if type(min_length) is not int:# noqa: E721raise TypeError(f'Job parameter "{name}" got {type(min_length).__name__} for "minLength" but expected int')if min_length < 0:raise ValueError(f'Job parameter "{name}" got {min_length} for "minLength" but the value must be non-negative')# Validate "maxLength"if "maxLength" in input:max_length = input["maxLength"]if type(max_length) is not int:# noqa: E721raise TypeError(f'Job parameter "{name}" got "{type(max_length).__name__}" for "maxLength" but expected int')if max_length < 0:raise ValueError(f'Job parameter "{name}" got {max_length} for "maxLength" but the value must be non-negative')# Validate "minValue"if "minValue" in input:min_value = input["minValue"]if isinstance(min_value, str):try:float(min_value)except ValueError:raise ValueError(f'Job parameter "{name}" has a non-numeric string value for "minValue": {min_value}')elif type(min_value) not in (int, float):# noqa: E721raise TypeError(f'Job parameter "{name}" got {type(min_value).__name__} for "minValue" but expected int')# Validate "maxValue"if "maxValue" in input:max_value = input["maxValue"]if isinstance(max_value, str):try:float(max_value)except ValueError:raise ValueError(f'Job parameter "{name}" has a non-numeric string value for "maxValue": {max_value}')elif type(max_value) not in (int, float):# noqa: E721raise TypeError(f'Job parameter "{name}" got {type(max_value).__name__} for "maxValue" but expected int')# Validate "objectType"if "objectType" in input:object_type = input["objectType"]if object_type not in ("FILE", "DIRECTORY"):raise ValueError(f'Job parameter "{name}" got {object_type} for "objectType" but expected one of ("FILE", "DIRECTORY")')# Validate "userInterface"if "userInterface" in input:validate_user_interface_spec(input["userInterface"],parameter_name=name,)return cast(JobParameter, input)
35
106
3
470
12
78
249
78
input,type_required,default_required
['data_flow', 'typ', 'allowed_values', 'min_length', 'default', 'description', 'max_length', 'min_value', 'quoted', 'max_value', 'object_type', 'name']
JobParameter
{"Assign": 12, "Expr": 4, "If": 31, "Return": 1, "Try": 2}
43
172
43
["isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "ValueError", "join", "ValueError", "ValueError", "ValueError", "isinstance", "TypeError", "type", "ValueError", "type", "TypeError", "type", "ValueError", "type", "TypeError", "type", "ValueError", "isinstance", "float", "ValueError", "type", "TypeError", "type", "isinstance", "float", "ValueError", "type", "TypeError", "type", "ValueError", "validate_user_interface_spec", "cast"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._queue_parameters_py.get_queue_parameter_definitions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.read_job_bundle_parameters"]
The function (validate_job_parameter) defined within the public class called public.The function start at line 78 and ends at 249. It contains 106 lines of code and it has a cyclomatic complexity of 35. It takes 3 parameters, represented as [78.0] and does not return any value. It declares 43.0 functions, It has 43.0 functions called inside which are ["isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "ValueError", "join", "ValueError", "ValueError", "ValueError", "isinstance", "TypeError", "type", "ValueError", "type", "TypeError", "type", "ValueError", "type", "TypeError", "type", "ValueError", "isinstance", "float", "ValueError", "type", "TypeError", "type", "isinstance", "float", "ValueError", "type", "TypeError", "type", "ValueError", "validate_user_interface_spec", "cast"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._queue_parameters_py.get_queue_parameter_definitions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.read_job_bundle_parameters"].
aws-deadline_deadline-cloud
public
public
0
0
validate_job_parameter_value
def validate_job_parameter_value(job_parameter: JobParameter,value: str | int | float,) -> str | int | float:"""Validates a value for the specified parameter definition, returning the value with the correct type,e.g. a string "19" for an INT parameter is returned as the integer 19.Raises a ValueError if validation fails.See https://github.com/OpenJobDescription/openjd-specifications/wiki/2023-09-Template-Schemas#2-jobparameterdefinitionArgs:job_parameter: The parameter definition.value: The value to validate.Returns:The value, converted to the correct type for the parameter definition."""name = job_parameter["name"]param_type = job_parameter["type"]# First ensure the value has the correct typeif param_type in ("STRING", "PATH"):if not isinstance(value, str):raise TypeError(f"Job parameter {name!r} has type {param_type} but got value {value!r} of type {type(value)}.")elif param_type == "INT":original_value = valuetry:if isinstance(value, str):value = int(value)else:value = int(value)# In the case of converting a float to an integer, the value gets truncated.# Check if the value was modified, and raise if so.if not isinstance(original_value, str) and value != original_value:value = original_valueraise ValueError()except ValueError:raise ValueError(f"Job parameter {name!r} has type INT but got value {value!r} which is not an integer.")elif param_type == "FLOAT":try:value = float(value)except ValueError:raise ValueError(f"Job parameter {name!r} has type FLOAT but got value {value!r} which is not floating point.")else:raise TypeError(f"The definition for job parameter {name!r} has unsupported type {param_type!r}")# Then ensure the value satisfies the constraints in the parameter definition.# Assumes the parameter definition is already validated, so the existence or not# of constraint fields is enough, don't need to gate by type.min_length = job_parameter.get("minLength")if min_length is not None:if len(value) < min_length:# type: ignoreraise ValueError(f"Job parameter {name!r} value {value!r} is shorter than minLength {min_length}.")max_length = job_parameter.get("maxLength")if max_length is not None:if len(value) > max_length:# type: ignoreraise ValueError(f"Job parameter {name!r} value {value!r} is longer than maxLength {max_length}.")min_value = job_parameter.get("minValue")if min_value is not None:if value < min_value:# type: ignoreraise ValueError(f"Job parameter {name!r} value {value!r} is less than minValue {min_value}.")max_value = job_parameter.get("maxValue")if max_value is not None:if value > max_value:# type: ignoreraise ValueError(f"Job parameter {name!r} value {value!r} is greater than maxValue {max_value}.")allowed_values = job_parameter.get("allowedValues")if allowed_values is not None:if value not in allowed_values:# type: ignoreraise ValueError(f"Job parameter {name!r} value {value!r} is not an allowed value from {tuple(allowed_values)!r}.")return value
20
67
2
284
9
252
344
252
job_parameter,value
['original_value', 'allowed_values', 'min_length', 'value', 'min_value', 'max_length', 'max_value', 'name', 'param_type']
str | int | float
{"Assign": 12, "Expr": 1, "If": 16, "Return": 1, "Try": 2}
25
93
25
["isinstance", "TypeError", "type", "isinstance", "int", "int", "isinstance", "ValueError", "ValueError", "float", "ValueError", "TypeError", "job_parameter.get", "len", "ValueError", "job_parameter.get", "len", "ValueError", "job_parameter.get", "ValueError", "job_parameter.get", "ValueError", "job_parameter.get", "ValueError", "tuple"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"]
The function (validate_job_parameter_value) defined within the public class called public.The function start at line 252 and ends at 344. It contains 67 lines of code and it has a cyclomatic complexity of 20. It takes 2 parameters, represented as [252.0] and does not return any value. It declares 25.0 functions, It has 25.0 functions called inside which are ["isinstance", "TypeError", "type", "isinstance", "int", "int", "isinstance", "ValueError", "ValueError", "float", "ValueError", "TypeError", "job_parameter.get", "len", "ValueError", "job_parameter.get", "len", "ValueError", "job_parameter.get", "ValueError", "job_parameter.get", "ValueError", "job_parameter.get", "ValueError", "tuple"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"].
aws-deadline_deadline-cloud
public
public
0
0
validate_user_interface_spec
def validate_user_interface_spec(input: Any, *, parameter_name: str) -> UserInterfaceSpec:"""Validates a job parameter's "userInterface" field as defined by Open Job Description. Thevalidation allows for the union of all possible parameter "type"s.Note that the validation does not currently handle per-type validation (e.g. minValue onlyallowed on parameters of type "INT" / "FLOAT")userInterface: # @optionalcontrol: enum("CHECK_BOX", "CHOOSE_DIRECTORY", "CHOOSE_INPUT_FILE", "CHOOSE_OUTPUT_FILE", "DROPDOWN_LIST", "LINE_EDIT", "MULTILINE_EDIT", "SPIN_BOX")label: <UserInterfaceLabelString> # @optionalgroupLabel: <UserInterfaceLabelStringValue> # @optionalfileFilters: [{label: str,patterns: [str]},...] # @optionalfileFilterDefault: {label: str,patterns: [str]} # @optionalsingleStepDelta: <positiveint> | <positivefloat> # @optionalParameters----------input : AnyThe input to validateparameter_name : strThe parameter name whose "userInterface" field is being validated. This is used forproducing user-friendly error messagesRaises------ValueErrorThe input contains a non-valid valueTypeErrorThe input or one of its fields are not of the expected typeReturns-------UserInterfaceSpecA type-cast version of the input. This is the same object reference to the input, but thedata has been validated."""if not isinstance(input, dict):raise TypeError(f"Expected a dict but got {type(input).__name__}")# Validate "control"if "control" in input:control = input["control"]if control not in _VALID_UI_CONTROLS:quoted = (f'"{valid_ui_control}"' for valid_ui_control in _VALID_UI_CONTROLS)raise ValueError(f'Job parameter "{parameter_name}" got but expected one of ({", ".join(quoted)}) for "userInterface" -> "control" but got {control}')# Validate "label"if "label" in input:label = input["label"]if not isinstance(label, str):raise TypeError(f'Job parameter "{parameter_name}" got {type(label).__name__} for "userInterface" -> "label" but expected str')# Validate "groupLabel"if "groupLabel" in input:group_label = input["groupLabel"]if not isinstance(group_label, str):raise TypeError(f'Job parameter "{parameter_name}" got {type(group_label).__name__} for "userInterface" -> "groupLabel" but expected str')# Validate "decimals"if "decimals" in input:decimals = input["decimals"]if type(decimals) is not int:# noqa: E721raise TypeError(f'Job parameter "{parameter_name}" got {type(decimals).__name__} for "userInterface" -> "decimals" but expected int')if decimals < 0:raise ValueError(f'Job parameter "{parameter_name}" got {decimals} for "userInterface" -> "decimals" but expected a non-negative int')# Validate "singleStepDelta"if "singleStepDelta" in input:single_step_delta = input["singleStepDelta"]if type(single_step_delta) not in (int, float):raise TypeError(f'Job parameter "{parameter_name}" got but expected float for "userInterface" -> "singleStepDelta", but got {type(single_step_delta).__name__}')if single_step_delta <= 0:raise ValueError(f'Job parameter "{parameter_name}" got {single_step_delta} for "userInterface" -> "singleStepDelta" but expected a positive number')if "fileFilters" in input:file_filters = input["fileFilters"]if not isinstance(file_filters, list):raise TypeError(f'Job parameter "{parameter_name}" got but expected list for "userInterface" -> "fileFilters", but got {type(file_filters).__name__}')for i, file_filter in enumerate(file_filters):validate_user_interface_file_filter(file_filter,parameter_name=parameter_name,field_path=f'"userInterface" -> "fileFilters" -> [{i}]',)if "fileFilterDefault" in input:file_filter_default = input["fileFilterDefault"]validate_user_interface_file_filter(file_filter_default,parameter_name=parameter_name,field_path='"userInterface" -> "fileFilterDefault"',)return cast(UserInterfaceSpec, input)
19
62
2
275
8
347
465
347
input,parameter_name
['file_filter_default', 'decimals', 'control', 'single_step_delta', 'quoted', 'file_filters', 'label', 'group_label']
UserInterfaceSpec
{"Assign": 8, "Expr": 3, "For": 1, "If": 16, "Return": 1}
26
119
26
["isinstance", "TypeError", "type", "ValueError", "join", "isinstance", "TypeError", "type", "isinstance", "TypeError", "type", "type", "TypeError", "type", "ValueError", "type", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "enumerate", "validate_user_interface_file_filter", "validate_user_interface_file_filter", "cast"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.validate_job_parameter"]
The function (validate_user_interface_spec) defined within the public class called public.The function start at line 347 and ends at 465. It contains 62 lines of code and it has a cyclomatic complexity of 19. It takes 2 parameters, represented as [347.0] and does not return any value. It declares 26.0 functions, It has 26.0 functions called inside which are ["isinstance", "TypeError", "type", "ValueError", "join", "isinstance", "TypeError", "type", "isinstance", "TypeError", "type", "type", "TypeError", "type", "ValueError", "type", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "enumerate", "validate_user_interface_file_filter", "validate_user_interface_file_filter", "cast"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.validate_job_parameter"].
aws-deadline_deadline-cloud
public
public
0
0
validate_user_interface_file_filter
def validate_user_interface_file_filter(input: Any,*,parameter_name: str,field_path: str,) -> UserInterfaceFileFilter:"""Validates values in a job parameter structure in the following object paths:1."userInterface" -> "fileFilters" -> []2."userInterface" -> "fileFilterDefault"The expected format is:label: strpatterns: [str, ...]Parameters----------input : AnyThe input to validateparameter_name : strThe parameter name whose "userInterface" field is being validated. This is used forproducing user-friendly error messagesfield_path : strThe JSON path to the field within the job parameter being validated. This is used to produceuser-friendly error messages. For example:"userInterface" -> "fileFilters" -> [1]Raises------TypeErrorWhen a field contains an incorrect typeValueErrorWhen a field contains a non-valid valueReturns-------UserInterfaceFileFilterA type-cast version of the input. This is the same object reference to the input, but thedata has been validated."""if not isinstance(input, dict):raise TypeError(f'Job parameter "{parameter_name}" got {type(input).__name__} for {field_path} but expected a dict')# Validation for "label"if "label" not in input:raise ValueError(f'Job parameter "{parameter_name}" is missing required key {field_path} -> "label"')else:label = input["label"]if not isinstance(label, str):raise TypeError(f'Job parameter "{parameter_name}" got {type(label).__name__} for {field_path} -> "label" but expected str')# Validation for "patterns"if "patterns" not in input:raise ValueError(f'Job parameter "{parameter_name}" is missing required key {field_path} -> "patterns"')else:patterns = input["patterns"]if not isinstance(patterns, list):raise TypeError(f'Job parameter "{parameter_name}" got {type(patterns).__name__} for {field_path} -> "patterns" but expected list')for i, pattern in enumerate(patterns):if not isinstance(pattern, str):raise TypeError(f'Job parameter "{parameter_name}" got "{repr(pattern)}" for {field_path} -> "patterns" [{i}] but expected str')elif not (0 < len(pattern) <= 20):raise ValueError(f'Job parameter "{parameter_name}" got "{pattern}" for {field_path} -> "patterns" [{i}] but must be between 1 and 20 characters')return cast(UserInterfaceFileFilter, input)
9
40
3
157
2
468
549
468
input,parameter_name,field_path
['label', 'patterns']
UserInterfaceFileFilter
{"Assign": 2, "Expr": 1, "For": 1, "If": 7, "Return": 1}
18
82
18
["isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "enumerate", "isinstance", "TypeError", "repr", "len", "ValueError", "cast"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.validate_user_interface_spec"]
The function (validate_user_interface_file_filter) defined within the public class called public.The function start at line 468 and ends at 549. It contains 40 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [468.0] and does not return any value. It declares 18.0 functions, It has 18.0 functions called inside which are ["isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "ValueError", "isinstance", "TypeError", "type", "enumerate", "isinstance", "TypeError", "repr", "len", "ValueError", "cast"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.validate_user_interface_spec"].
aws-deadline_deadline-cloud
public
public
0
0
merge_queue_job_parameters
def merge_queue_job_parameters(*,job_parameters: list[JobParameter],queue_parameters: list[JobParameter],queue_id: str | None = None,) -> list[JobParameter]:"""This function merges the queue environment parameters and the job bundle parameters. Thisprimarily functions as a set union operation with a few added semantics:1.The merge validates that parameters with the same name agree on the parameter type,otherwise a DeadlineOperationError exception is raised2.If both the queue and job bundle have a parameter with the same name that specify defaultvalues, then the job bundle's default will take priorityParameters----------job_parameters : list[JobParameter]The parameters from the job bundlequeue_parameters : list[JobParameter]The parameters from the target queue's environmentRaises------DeadlineOperationErrorRaised if the job bundle and queue share a parameter with the same name but different typesReturns-------list[JobParameter]The merged parameters"""# Make a dict structure of the queue parameters for easy lookup by name.# We later mutate the values, so the values are shallow copies of the queue's parameter dictscollected_parameters: dict[str, JobParameter] = {param["name"]: param.copy() for param in queue_parameters}ParameterTypeMismatch = namedtuple("ParameterTypeMismatch", ("param_name", "differences"))param_mismatches: list[ParameterTypeMismatch] = []for job_parameter in job_parameters:job_parameter_name = job_parameter["name"]if job_parameter_name in collected_parameters:# Check for type mismatch between queue and job bundlecollected_parameter = collected_parameters[job_parameter_name]# If the job parameter includes a value, always copy it to the collected parameterif "value" in job_parameter:collected_parameter["value"] = job_parameter["value"]# If the job parameter doesn't include a definition, there's nothing more to mergeif {"name", "value"} == set(job_parameter.keys()):continue# If the job parameter includes a default, always copy it to the collected parameterif "default" in job_parameter:collected_parameter["default"] = job_parameter["default"]differences = parameter_definition_difference(collected_parameter, job_parameter)# Ignore any differences in the default valuedifferences = [name for name in differences if name != "default"]if differences:param_mismatches.append(ParameterTypeMismatch(param_name=job_parameter_name, differences=differences))else:# app-specific parameters have implicit definitions based on their "name"if {"name", "value"} == job_parameter.keys() and ":" not in job_parameter_name:raise DeadlineOperationError(f'Parameter value was provided for an undefined parameter "{job_parameter_name}"')collected_parameters[job_parameter_name] = job_parameter.copy()if param_mismatches:param_strs = [f'\t{param_mismatch.param_name}: differences for fields "{param_mismatch.differences}"'for param_mismatch in param_mismatches]queue_str = f"queue ({queue_id})" if queue_id else "queue"raise DeadlineOperationError(f"The target {queue_str} and job bundle have conflicting parameter definitions:\n\n"+ "\n".join(param_strs))return list(collected_parameters.values())
15
44
3
265
6
552
639
552
job_parameters,queue_parameters,queue_id
['param_strs', 'job_parameter_name', 'collected_parameter', 'ParameterTypeMismatch', 'differences', 'queue_str']
list[JobParameter]
{"AnnAssign": 2, "Assign": 10, "Expr": 2, "For": 1, "If": 7, "Return": 1}
14
88
14
["param.copy", "namedtuple", "set", "job_parameter.keys", "parameter_definition_difference", "param_mismatches.append", "ParameterTypeMismatch", "job_parameter.keys", "DeadlineOperationError", "job_parameter.copy", "DeadlineOperationError", "join", "list", "collected_parameters.values"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"]
The function (merge_queue_job_parameters) defined within the public class called public.The function start at line 552 and ends at 639. It contains 44 lines of code and it has a cyclomatic complexity of 15. It takes 3 parameters, represented as [552.0] and does not return any value. It declares 14.0 functions, It has 14.0 functions called inside which are ["param.copy", "namedtuple", "set", "job_parameter.keys", "parameter_definition_difference", "param_mismatches.append", "ParameterTypeMismatch", "job_parameter.keys", "DeadlineOperationError", "job_parameter.copy", "DeadlineOperationError", "join", "list", "collected_parameters.values"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"].
aws-deadline_deadline-cloud
public
public
0
0
apply_job_parameters
def apply_job_parameters(job_parameters: list[dict[str, Any]],job_bundle_dir: str,parameters: list[JobParameter],asset_references: AssetReferences,) -> None:"""Modifies the provided parameters and asset_references to incorporatethe job_parameters and to resolve any relative paths in PATH parameters.The following actions are taken:- Any job_parameters provided set or replace the "value" key in the correspondingjob_bundle_parameters entry.- Any job_parameters for a PATH, that is a relative path, is made absolute by joiningwith the current working directory.- Any job_bundle_parameters for a PATH, not set by job_parameters, that is arelative path, is made absolute by joining with the job bundle directory.- Any PATH parameters that have IN, OUT, or INOUT assetReferences metadata areadded to the appropriate asset_references entries."""# Convert the job_parameters to a dict for efficient lookupparam_dict: dict[str, Any] = {parameter["name"]: parameter["value"] for parameter in job_parameters}for parameter in parameters:# Get the definition from the job bundleparameter_type = parameter.get("type", None)if not parameter_type:continueparameter_name = parameter["name"]# Apply the job_parameters value if availableparameter_value = param_dict.pop(parameter_name, None)if parameter_value is not None:# Make PATH parameter values that are not constrained by allowedValues# absolute by joining with the current working directoryif parameter_type == "PATH" and "allowedValues" not in parameter:if parameter_value == "":continueparameter_value = os.path.abspath(parameter_value)parameter["value"] = parameter_valueelse:parameter_value = parameter.get("value", parameter.get("default"))if parameter_value is None:raise DeadlineOperationError(f"Job Template for job bundle {job_bundle_dir}:\nNo parameter value provided for Job Template parameter {parameter_name}, and it has no default value.")# If it's a PATH parameter with dataFlow, add it to asset_referencesif parameter_type == "PATH":data_flow = parameter.get("dataFlow", "NONE")if data_flow not in ("NONE", "IN", "OUT", "INOUT"):raise DeadlineOperationError(f"Job Template for job bundle {job_bundle_dir}:\nJob Template parameter {parameter_name} had an incorrect "+ f"value {data_flow} for 'dataFlow'. Valid values are "+ "['NONE', 'IN', 'OUT', 'INOUT']")if data_flow == "NONE":# This path is referenced, but its contents are not necessarily# input or output.asset_references.referenced_paths.add(parameter_value)elif parameter_value != "":# While empty parameters are allowed, we don't want to add them to asset referencesobject_type = parameter.get("objectType")if "IN" in data_flow:if object_type == "FILE":asset_references.input_filenames.add(parameter_value)else:asset_references.input_directories.add(parameter_value)if "OUT" in data_flow:if object_type == "FILE":# TODO: When job attachments supports output files in addition to directories, change this to# add the filename instead.asset_references.output_directories.add(os.path.dirname(parameter_value))else:asset_references.output_directories.add(parameter_value)
17
49
4
289
5
642
720
642
job_parameters,job_bundle_dir,parameters,asset_references
['data_flow', 'parameter_type', 'parameter_name', 'parameter_value', 'object_type']
None
{"AnnAssign": 1, "Assign": 8, "Expr": 6, "For": 1, "If": 13}
15
79
15
["parameter.get", "param_dict.pop", "os.path.abspath", "parameter.get", "parameter.get", "DeadlineOperationError", "parameter.get", "DeadlineOperationError", "asset_references.referenced_paths.add", "parameter.get", "asset_references.input_filenames.add", "asset_references.input_directories.add", "asset_references.output_directories.add", "os.path.dirname", "asset_references.output_directories.add"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"]
The function (apply_job_parameters) defined within the public class called public.The function start at line 642 and ends at 720. It contains 49 lines of code and it has a cyclomatic complexity of 17. It takes 4 parameters, represented as [642.0] and does not return any value. It declares 15.0 functions, It has 15.0 functions called inside which are ["parameter.get", "param_dict.pop", "os.path.abspath", "parameter.get", "parameter.get", "DeadlineOperationError", "parameter.get", "DeadlineOperationError", "asset_references.referenced_paths.add", "parameter.get", "asset_references.input_filenames.add", "asset_references.input_directories.add", "asset_references.output_directories.add", "os.path.dirname", "asset_references.output_directories.add"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter"].
aws-deadline_deadline-cloud
public
public
0
0
read_job_bundle_parameters
def read_job_bundle_parameters(bundle_dir: str) -> list[JobParameter]:"""Reads the parameter definitions and parameter values from the job bundle. Forany relative PATH parameters with data flow where no parameter value is supplied,it sets the value to that path relative to the job bundle directory.Return format:[{"name": <parameter name>,<all fields from the the "parameters" value in template.json/yaml>"value": <if provided from parameter_values.json/yaml>},...]"""template = read_yaml_or_json_object(bundle_dir=bundle_dir, filename="template", required=True)parameter_values = read_yaml_or_json_object(bundle_dir=bundle_dir, filename="parameter_values", required=False)if not isinstance(template, dict):raise DeadlineOperationError(f"Job Template for job bundle {bundle_dir}:\nThe document does not contain a top-level object.")# Get the spec version of the templateif "specificationVersion" not in template:raise DeadlineOperationError(f"Job Template for job bundle {bundle_dir}:\nDocument does not contain a specificationVersion.")elif template.get("specificationVersion") not in ["jobtemplate-2023-09"]:raise DeadlineOperationError(f"Job Template for job bundle {bundle_dir}:\nDocument has an unsupported specificationVersion: {template.get('specificationVersion')}")# Start with the template parameters, converting them from a list into a dictionarytemplate_parameters: dict[str, dict[str, Any]] = {}if "parameterDefinitions" in template:# parameters are a list of objects. Convert it to a map# from name -> parameterif not isinstance(template["parameterDefinitions"], list):raise DeadlineOperationError(f"Job Template for job bundle {bundle_dir}:\nJob parameter definitions must be a list.")template_parameters = {param["name"]: param for param in template["parameterDefinitions"]}# Add the parameter values where providedif parameter_values:for parameter_value in parameter_values.get("parameterValues", []):name = parameter_value["name"]if name in template_parameters:template_parameters[name]["value"] = parameter_value["value"]else:# Keep the other parameter values around, they may be# provide values for queue parameters or specific render farm# values such as "deadline:*"template_parameters[name] = parameter_value# Make valueless PATH parameters with 'default' (but not constrained# by allowedValues) absolute by joining with the job bundle directoryfor name, parameter in template_parameters.items():if ("value" not in parameterand parameter["type"] == "PATH"and "allowedValues" not in parameter):default = parameter.get("default")if default:if os.path.isabs(default):raise DeadlineOperationError(f"Job Template for job bundle {bundle_dir}:\nDefault PATH '{default}' for parameter '{name}' is absolute.\nPATH values must be relative, and must resolve within the Job Bundle directory.")bundle_real_path = os.path.realpath(bundle_dir)default_real_path = os.path.realpath(os.path.join(bundle_real_path, default))common_path = os.path.commonpath([bundle_real_path, default_real_path])if common_path != bundle_real_path:raise DeadlineOperationError(f"Job Template for job bundle {bundle_dir}:\nDefault PATH '{default_real_path}' for parameter '{name}' specifies files outside of Job Bundle directory '{bundle_real_path}'.\nPATH values must be relative, and must resolve within the Job Bundle directory.")default_absolute = os.path.normpath(os.path.abspath(os.path.join(bundle_dir, default)))parameter["value"] = default_absolute# Rearrange the dict from the template into a listparameters = [validate_job_parameter({"name": name, **values})for name, values in template_parameters.items()]# Validate hidden parameters have valuesinvalid_params = []for param in parameters:if param.get("userInterface", {}).get("control") == "HIDDEN":parameter_value = param.get("value")if parameter_value is None or parameter_value == "":parameter_value = param.get("default")if parameter_value is None or parameter_value == "":invalid_params.append(param["name"])if invalid_params:if len(invalid_params) == 1:message = f'Job bundle validation failed:\nHidden parameter "{invalid_params[0]}" is missing a value.'else:param_list = ", ".join(f'"{name}"' for name in invalid_params)message = (f"Job bundle validation failed:\nHidden parameters {param_list} are missing values.")message += " Hidden parameters must have either a default value in the template or a value in parameter_values.yaml."raise DeadlineOperationError(message)return parameters
27
77
1
479
14
723
838
723
bundle_dir
['invalid_params', 'template_parameters', 'default_real_path', 'default_absolute', 'parameters', 'parameter_values', 'common_path', 'default', 'parameter_value', 'name', 'template', 'param_list', 'message', 'bundle_real_path']
list[JobParameter]
{"AnnAssign": 1, "Assign": 19, "AugAssign": 1, "Expr": 2, "For": 3, "If": 16, "Return": 1}
33
116
33
["read_yaml_or_json_object", "read_yaml_or_json_object", "isinstance", "DeadlineOperationError", "DeadlineOperationError", "template.get", "DeadlineOperationError", "template.get", "isinstance", "DeadlineOperationError", "parameter_values.get", "template_parameters.items", "parameter.get", "os.path.isabs", "DeadlineOperationError", "os.path.realpath", "os.path.realpath", "os.path.join", "os.path.commonpath", "DeadlineOperationError", "os.path.normpath", "os.path.abspath", "os.path.join", "validate_job_parameter", "template_parameters.items", "get", "param.get", "param.get", "param.get", "invalid_params.append", "len", "join", "DeadlineOperationError"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_read_job_bundle_parameters"]
The function (read_job_bundle_parameters) defined within the public class called public.The function start at line 723 and ends at 838. It contains 77 lines of code and it has a cyclomatic complexity of 27. The function does not take any parameters and does not return any value. It declares 33.0 functions, It has 33.0 functions called inside which are ["read_yaml_or_json_object", "read_yaml_or_json_object", "isinstance", "DeadlineOperationError", "DeadlineOperationError", "template.get", "DeadlineOperationError", "template.get", "isinstance", "DeadlineOperationError", "parameter_values.get", "template_parameters.items", "parameter.get", "os.path.isabs", "DeadlineOperationError", "os.path.realpath", "os.path.realpath", "os.path.join", "os.path.commonpath", "DeadlineOperationError", "os.path.normpath", "os.path.abspath", "os.path.join", "validate_job_parameter", "template_parameters.items", "get", "param.get", "param.get", "param.get", "invalid_params.append", "len", "join", "DeadlineOperationError"], It has 4.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_bundle_loader_py.test_read_job_bundle_parameters"].
aws-deadline_deadline-cloud
public
public
0
0
get_ui_control_for_parameter_definition
def get_ui_control_for_parameter_definition(param_def: JobParameter) -> str:"""Returns the UI control for the given parameter definition, determiningthe default if not explicitly set."""# If it's explicitly provided, return thatcontrol = param_def.get("userInterface", {}).get("control")param_type = param_def["type"]if not control:if "allowedValues" in param_def:control = "DROPDOWN_LIST"elif param_type == "STRING":return "LINE_EDIT"elif param_type == "PATH":if param_def.get("objectType", "DIRECTORY") == "FILE":if param_def.get("dataFlow", "NONE") == "OUT":return "CHOOSE_OUTPUT_FILE"else:return "CHOOSE_INPUT_FILE"else:return "CHOOSE_DIRECTORY"elif param_type in ("INT", "FLOAT"):return "SPIN_BOX"else:raise DeadlineOperationError(f"The job template parameter '{param_def.get('name', '<unnamed>')}' "+ f"specifies an unsupported type '{param_type}'.")if control not in _SUPPORTED_CONTROLS_FOR_TYPE[param_type]:raise DeadlineOperationError(f"The job template parameter '{param_def.get('name', '<unnamed>')}' "+ f"specifies an unsupported control '{control}' for its type '{param_type}'.")if control == "DROPDOWN_LIST" and "allowedValues" not in param_def:raise DeadlineOperationError(f"The job template parameter '{param_def.get('name', '<unnamed>')}' "+ "must supply 'allowedValues' if it uses a DROPDOWN_LIST control.")return control
11
34
1
150
2
855
894
855
param_def
['control', 'param_type']
str
{"Assign": 3, "Expr": 1, "If": 9, "Return": 6}
10
40
10
["get", "param_def.get", "param_def.get", "param_def.get", "DeadlineOperationError", "param_def.get", "DeadlineOperationError", "param_def.get", "DeadlineOperationError", "param_def.get"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._queue_parameters_py.get_queue_parameter_definitions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.openjd_parameters_widget_py.OpenJDParametersWidget.rebuild_ui"]
The function (get_ui_control_for_parameter_definition) defined within the public class called public.The function start at line 855 and ends at 894. It contains 34 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value. It declares 10.0 functions, It has 10.0 functions called inside which are ["get", "param_def.get", "param_def.get", "param_def.get", "DeadlineOperationError", "param_def.get", "DeadlineOperationError", "param_def.get", "DeadlineOperationError", "param_def.get"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._queue_parameters_py.get_queue_parameter_definitions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.openjd_parameters_widget_py.OpenJDParametersWidget.rebuild_ui"].
aws-deadline_deadline-cloud
public
public
0
0
_parameter_definition_fields_equivalent
def _parameter_definition_fields_equivalent(lhs: JobParameter,rhs: JobParameter,field_name: str,set_comparison: bool = False,) -> bool:lhs_value = lhs.get(field_name)rhs_value = rhs.get(field_name)if set_comparison and lhs_value is not None and rhs_value is not None:# Used to type-narrow at type-check timeassert isinstance(lhs_value, list) and isinstance(rhs_value, list)return set(lhs_value) == set(rhs_value)else:return lhs_value == rhs_value
5
13
4
83
2
897
910
897
lhs,rhs,field_name,set_comparison
['rhs_value', 'lhs_value']
bool
{"Assign": 2, "If": 1, "Return": 2}
6
14
6
["lhs.get", "rhs.get", "isinstance", "isinstance", "set", "set"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.parameter_definition_difference"]
The function (_parameter_definition_fields_equivalent) defined within the public class called public.The function start at line 897 and ends at 910. It contains 13 lines of code and it has a cyclomatic complexity of 5. It takes 4 parameters, represented as [897.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions called inside which are ["lhs.get", "rhs.get", "isinstance", "isinstance", "set", "set"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.parameter_definition_difference"].
aws-deadline_deadline-cloud
public
public
0
0
parameter_definition_difference
def parameter_definition_difference(lhs: JobParameter, rhs: JobParameter, *, ignore_missing: bool = False) -> list[str]:"""Compares the two parameter definitions, returning a list of fields which differ.Does not compare the userInterface properties.Parameters----------lhs : JobParameterThe "left-hand-side" job parameter to comparerhs : JobParameterThe "right-hand-side" job parameter to compareignore_missing : boolWhether to ignore missing fields in the comparison. Defaults to FalseReturns-------list[str]The fields whose values differ between lhs and rhs"""differences = []# Compare these properties as valuesfor name in ("name","type","minValue","maxValue","minLength","maxLength","dataFlow","objectType",):if ignore_missing and (name not in lhs or name not in rhs):continueif not _parameter_definition_fields_equivalent(lhs, rhs, name):differences.append(name)# Compare these properties as setsfor name in ("allowedValues",):if ignore_missing and (name not in lhs or name not in rhs):continueif not _parameter_definition_fields_equivalent(lhs, rhs, name, set_comparison=True):differences.append(name)return differences
11
24
3
131
1
913
955
913
lhs,rhs,ignore_missing
['differences']
list[str]
{"Assign": 1, "Expr": 3, "For": 2, "If": 4, "Return": 1}
4
43
4
["_parameter_definition_fields_equivalent", "differences.append", "_parameter_definition_fields_equivalent", "differences.append"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._queue_parameters_py.get_queue_parameter_definitions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.merge_queue_job_parameters"]
The function (parameter_definition_difference) defined within the public class called public.The function start at line 913 and ends at 955. It contains 24 lines of code and it has a cyclomatic complexity of 11. It takes 3 parameters, represented as [913.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside which are ["_parameter_definition_fields_equivalent", "differences.append", "_parameter_definition_fields_equivalent", "differences.append"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._queue_parameters_py.get_queue_parameter_definitions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.job_bundle.parameters_py.merge_queue_job_parameters"].
aws-deadline_deadline-cloud
public
public
0
0
save_yaml_or_json_to_file
def save_yaml_or_json_to_file(bundle_dir: str,filename: str,file_type: str,data: Any,) -> None:"""Saves data as either a JSON or YAML file depending on the file_type provided. Useful for savingjob bundle data files which can be in either format. file_type should be either "YAML" or "JSON"."""with open(os.path.join(bundle_dir, f"{filename}.{file_type.lower()}"), "w", encoding="utf8") as f:if file_type == "YAML":deadline_yaml_dump(data, f)elif file_type == "JSON":json.dump(data, f, indent=2)else:raise RuntimeError(f"Unexpected file type '{file_type}' in job bundle:\n{bundle_dir}")
3
15
4
83
0
9
27
9
bundle_dir,filename,file_type,data
[]
None
{"Expr": 3, "If": 2, "With": 1}
6
19
6
["open", "os.path.join", "file_type.lower", "deadline_yaml_dump", "json.dump", "RuntimeError"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_saver_py.test_save_yaml_or_json_to_file"]
The function (save_yaml_or_json_to_file) defined within the public class called public.The function start at line 9 and ends at 27. It contains 15 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [9.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions called inside which are ["open", "os.path.join", "file_type.lower", "deadline_yaml_dump", "json.dump", "RuntimeError"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_saver_py.test_save_yaml_or_json_to_file"].
aws-deadline_deadline-cloud
AssetReferences
public
0
0
__init__
def __init__(self,*,input_filenames: Optional[set[str]] = None,input_directories: Optional[set[str]] = None,output_directories: Optional[set[str]] = None,referenced_paths: Optional[set[str]] = None,):self.input_filenames = input_filenames or set()self.input_directories = input_directories or set()self.output_directories = output_directories or set()self.referenced_paths = referenced_paths or set()
5
12
5
92
0
41
52
41
self,input_filenames,input_directories,output_directories,referenced_paths
[]
None
{"Assign": 4}
4
12
4
["set", "set", "set", "set"]
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_py.TgScheduler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.CalculatedAmountDiscrepancyError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ExchangeRateMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.InvalidTransactionError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ParsingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.PriceMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.QuantityNotPositiveError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.SymbolMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedColumnCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedRowCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.raw_py.RawTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.trading212_py.Trading212Transaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.vanguard_py.VanguardTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.ExporterError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordFileDoesNotExistError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordTooLongError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.DeviceInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HomeAutomation.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostNumberOfEntries.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.LanInterfaceConfig.__init__"]
The function (__init__) defined within the public class called AssetReferences.The function start at line 41 and ends at 52. It contains 12 lines of code and it has a cyclomatic complexity of 5. It takes 5 parameters, represented as [41.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside which are ["set", "set", "set", "set"], It has 4993.0 functions calling this function which are ["_.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_py.TgScheduler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.CalculatedAmountDiscrepancyError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ExchangeRateMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.InvalidTransactionError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ParsingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.PriceMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.QuantityNotPositiveError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.SymbolMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedColumnCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedRowCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.raw_py.RawTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.trading212_py.Trading212Transaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.vanguard_py.VanguardTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.ExporterError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordFileDoesNotExistError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordTooLongError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.DeviceInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HomeAutomation.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostNumberOfEntries.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.LanInterfaceConfig.__init__"].
aws-deadline_deadline-cloud
AssetReferences
public
0
0
__bool__
def __bool__(self) -> bool:"""Returns whether the object has any asset references."""return (bool(self.input_filenames)or bool(self.input_directories)or bool(self.output_directories)or bool(self.referenced_paths))
4
7
1
38
0
54
61
54
self
[]
bool
{"Expr": 1, "Return": 1}
4
8
4
["bool", "bool", "bool", "bool"]
0
[]
The function (__bool__) defined within the public class called AssetReferences.The function start at line 54 and ends at 61. 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. It declares 4.0 functions, and It has 4.0 functions called inside which are ["bool", "bool", "bool", "bool"].
aws-deadline_deadline-cloud
AssetReferences
public
0
0
union
def union(self, other: AssetReferences):"""Returns the union of the asset references."""return AssetReferences(input_filenames=self.input_filenames.union(other.input_filenames),input_directories=self.input_directories.union(other.input_directories),output_directories=self.output_directories.union(other.output_directories),referenced_paths=self.referenced_paths.union(other.referenced_paths),)
1
7
2
66
0
63
70
63
self,other
[]
Returns
{"Expr": 1, "Return": 1}
5
8
5
["AssetReferences", "self.input_filenames.union", "self.input_directories.union", "self.output_directories.union", "self.referenced_paths.union"]
24
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646959_kristianoellegaard_django_hvad.hvad.models_py.TranslatedFields.create_translations_model", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953346_rsheftel_pandas_market_calendars.pandas_market_calendars.calendars.nyse_py.NYSEExchangeCalendar.date_range_htf", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3956605_inducer_pymbolic.pymbolic.mapper.__init___py.Collector.combine", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957198_kvesteri_sqlalchemy_utils.tests.relationships.test_select_correlated_expression_py.User", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967192_openstack_ironic_specs.tests.test_titles_py.TestTitles._check_titles", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.model.base_py.GetMixin.split_projection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.projection_py.ProjectionHelper._parse_projection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.props_py.PropsMixin.get_extra_projection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.services.users_py.get_current_user", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69766353_plasma_umass_slipcover.src.slipcover.bytecode_py.Branch.from_code", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69936553_pandas_dev_pandas_stubs.tests.indexes.test_indexes_py.test_index_union_sort", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69936553_pandas_dev_pandas_stubs.tests.indexes.test_indexes_py.test_range_index_union", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69951274_onekey_sec_unblob.python.unblob.cli_py.cli", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69951599_cybercentrecanada_assemblyline_v4_service.assemblyline_v4_service.common.ocr_py.update_ocr_config", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69993433_splitgraph_sgr.splitgraph.commandline.image_info_py.diff_c", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556496_BerriAI_litellm.litellm.litellm_core_utils.core_helpers_py.preserve_upstream_non_openai_attributes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556496_BerriAI_litellm.litellm.litellm_core_utils.model_param_helper_py.ModelParamHelper._get_litellm_supported_chat_completion_kwargs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556496_BerriAI_litellm.litellm.litellm_core_utils.model_param_helper_py.ModelParamHelper._get_litellm_supported_text_completion_kwargs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._get_job_sessions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_download_py.assert_download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_download_py.assert_progress_tracker_values", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_download_py.check_expected_files_present", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95146159_nrpy_nrpy.nrpy.infrastructures.BHaH.xx_tofrom_Cart_py._prepare_sympy_exprs_for_codegen", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95404293_tbabej_taskwiki.taskwiki.vwtask_py.VimwikiTask.__setitem__"]
The function (union) defined within the public class called AssetReferences.The function start at line 63 and ends at 70. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [63.0], and this function return a value. It declares 5.0 functions, It has 5.0 functions called inside which are ["AssetReferences", "self.input_filenames.union", "self.input_directories.union", "self.output_directories.union", "self.referenced_paths.union"], It has 24.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646959_kristianoellegaard_django_hvad.hvad.models_py.TranslatedFields.create_translations_model", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953346_rsheftel_pandas_market_calendars.pandas_market_calendars.calendars.nyse_py.NYSEExchangeCalendar.date_range_htf", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3956605_inducer_pymbolic.pymbolic.mapper.__init___py.Collector.combine", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3957198_kvesteri_sqlalchemy_utils.tests.relationships.test_select_correlated_expression_py.User", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967192_openstack_ironic_specs.tests.test_titles_py.TestTitles._check_titles", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.model.base_py.GetMixin.split_projection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.projection_py.ProjectionHelper._parse_projection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.props_py.PropsMixin.get_extra_projection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.services.users_py.get_current_user", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69766353_plasma_umass_slipcover.src.slipcover.bytecode_py.Branch.from_code", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69936553_pandas_dev_pandas_stubs.tests.indexes.test_indexes_py.test_index_union_sort", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69936553_pandas_dev_pandas_stubs.tests.indexes.test_indexes_py.test_range_index_union", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69951274_onekey_sec_unblob.python.unblob.cli_py.cli", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69951599_cybercentrecanada_assemblyline_v4_service.assemblyline_v4_service.common.ocr_py.update_ocr_config", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69993433_splitgraph_sgr.splitgraph.commandline.image_info_py.diff_c", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556496_BerriAI_litellm.litellm.litellm_core_utils.core_helpers_py.preserve_upstream_non_openai_attributes", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556496_BerriAI_litellm.litellm.litellm_core_utils.model_param_helper_py.ModelParamHelper._get_litellm_supported_chat_completion_kwargs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556496_BerriAI_litellm.litellm.litellm_core_utils.model_param_helper_py.ModelParamHelper._get_litellm_supported_text_completion_kwargs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._incremental_download_py._get_job_sessions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_download_py.assert_download_job_output", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_download_py.assert_progress_tracker_values", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.test_download_py.check_expected_files_present", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95146159_nrpy_nrpy.nrpy.infrastructures.BHaH.xx_tofrom_Cart_py._prepare_sympy_exprs_for_codegen", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95404293_tbabej_taskwiki.taskwiki.vwtask_py.VimwikiTask.__setitem__"].
aws-deadline_deadline-cloud
AssetReferences
public
0
0
from_dict
def from_dict(cls, obj: Optional[dict[str, Any]]) -> AssetReferences:if obj:input_filenames = obj["assetReferences"].get("inputs", {}).get("filenames", [])input_directories = obj["assetReferences"].get("inputs", {}).get("directories", [])output_directories = obj["assetReferences"].get("outputs", {}).get("directories", [])referenced_paths = obj["assetReferences"].get("referencedPaths", [])return cls(input_filenames=set(os.path.normpath(path) for path in input_filenames),input_directories=set(os.path.normpath(path) for path in input_directories),output_directories=set(os.path.normpath(path) for path in output_directories),referenced_paths=set(os.path.normpath(path) for path in referenced_paths),)else:return cls()
6
14
2
184
0
73
87
73
cls,obj
[]
AssetReferences
{"Assign": 4, "If": 1, "Return": 2}
17
15
17
["get", "get", "get", "get", "get", "get", "get", "cls", "set", "os.path.normpath", "set", "os.path.normpath", "set", "os.path.normpath", "set", "os.path.normpath", "cls"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_submission_py.test_flatten_asset_references", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95188692_yurujaja_pangaea_bench.pangaea.datasets.pastis_py.prepare_dates"]
The function (from_dict) defined within the public class called AssetReferences.The function start at line 73 and ends at 87. It contains 14 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [73.0] and does not return any value. It declares 17.0 functions, It has 17.0 functions called inside which are ["get", "get", "get", "get", "get", "get", "get", "cls", "set", "os.path.normpath", "set", "os.path.normpath", "set", "os.path.normpath", "set", "os.path.normpath", "cls"], It has 5.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.job_bundle_submitter_py.show_job_bundle_submitter", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_bundle_settings_tab_py.JobBundleSettingsWidget.on_load_bundle", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.job_bundle.test_job_submission_py.test_flatten_asset_references", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95188692_yurujaja_pangaea_bench.pangaea.datasets.pastis_py.prepare_dates"].
aws-deadline_deadline-cloud
AssetReferences
public
0
0
to_dict
def to_dict(self) -> dict[str, Any]:return {"assetReferences": {"inputs": {"directories": sorted(self.input_directories),"filenames": sorted(self.input_filenames),},"outputs": {"directories": sorted(self.output_directories)},"referencedPaths": sorted(self.referenced_paths),}}
1
11
1
64
0
89
99
89
self
[]
dict[str, Any]
{"Return": 1}
4
11
4
["sorted", "sorted", "sorted", "sorted"]
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.Output.Cloned_Repo_3.3967770_docusign_code_examples_python.app.docusign.ds_client_py.DSClient.get_token", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.model.base_py.ProperDictMixin.to_proper_dict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.utils_py.init_cls_from_base", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.services.models_py.edit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.services.tasks_py.edit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.59624560_openwpm_openwpm.openwpm.browser_manager_py.BrowserManagerHandle._unpack_pickled_error", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69272947_misp_misp_stix.tests._test_stix_export_py.TestCollectionSTIX1Export._check_stix1_collection_export_results", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69272947_misp_misp_stix.tests._test_stix_export_py.TestCollectionSTIX1Export._check_stix1_export_results", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69737800_eprbell_dali_rp2.src.dali.plugin.pair_converter.coinbase_advanced_py.PairConverterPlugin.get_historic_bar_from_native_source", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69848748_scverse_squidpy.src.squidpy.pl._ligrec_py.ligrec", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69936553_pandas_dev_pandas_stubs.tests.series.test_series_py.test_change_to_dict_return_type", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70258989_dynaconf_dynaconf.dynaconf.loaders.__init___py.write", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70258989_dynaconf_dynaconf.tests.test_base_py.test_dotted_set", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70538610_asfhyp3_hyp3_sdk.tests.test_hyp3_py.test_find_jobs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70538610_asfhyp3_hyp3_sdk.tests.test_hyp3_py.test_find_jobs_paging", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70538610_asfhyp3_hyp3_sdk.tests.test_hyp3_py.test_find_jobs_user_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.dataset.arrow.dec_py.ArrowDecoder.decode_batch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.ext.rotbaum._model_py.QRX.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.daf.tslib.engine.hyperopt_py.HyperOptManager.load_records", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.few_shot_prediction.src.meta.datasets.m1_py.generate_m1_dataset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.few_shot_prediction.src.meta.datasets.m3_py.generate_m3_dataset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.few_shot_prediction.src.meta.datasets.m4_py.generate_m4_dataset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.tsbench.src.tsbench.surrogate.transformers.config_py.DatasetCatch22Encoder.fit"]
The function (to_dict) defined within the public class called AssetReferences.The function start at line 89 and ends at 99. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside which are ["sorted", "sorted", "sorted", "sorted"], It has 35.0 functions calling this function which are ["_.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.Output.Cloned_Repo_3.3967770_docusign_code_examples_python.app.docusign.ds_client_py.DSClient.get_token", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.model.base_py.ProperDictMixin.to_proper_dict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.database.utils_py.init_cls_from_base", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.services.models_py.edit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3981965_allegroai_clearml_server.apiserver.services.tasks_py.edit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.59624560_openwpm_openwpm.openwpm.browser_manager_py.BrowserManagerHandle._unpack_pickled_error", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69272947_misp_misp_stix.tests._test_stix_export_py.TestCollectionSTIX1Export._check_stix1_collection_export_results", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69272947_misp_misp_stix.tests._test_stix_export_py.TestCollectionSTIX1Export._check_stix1_export_results", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69737800_eprbell_dali_rp2.src.dali.plugin.pair_converter.coinbase_advanced_py.PairConverterPlugin.get_historic_bar_from_native_source", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69848748_scverse_squidpy.src.squidpy.pl._ligrec_py.ligrec", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69936553_pandas_dev_pandas_stubs.tests.series.test_series_py.test_change_to_dict_return_type", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70258989_dynaconf_dynaconf.dynaconf.loaders.__init___py.write", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70258989_dynaconf_dynaconf.tests.test_base_py.test_dotted_set", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70538610_asfhyp3_hyp3_sdk.tests.test_hyp3_py.test_find_jobs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70538610_asfhyp3_hyp3_sdk.tests.test_hyp3_py.test_find_jobs_paging", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70538610_asfhyp3_hyp3_sdk.tests.test_hyp3_py.test_find_jobs_user_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.dataset.arrow.dec_py.ArrowDecoder.decode_batch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.ext.rotbaum._model_py.QRX.fit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.daf.tslib.engine.hyperopt_py.HyperOptManager.load_records", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.few_shot_prediction.src.meta.datasets.m1_py.generate_m1_dataset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.few_shot_prediction.src.meta.datasets.m3_py.generate_m3_dataset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.few_shot_prediction.src.meta.datasets.m4_py.generate_m4_dataset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70598532_awslabs_gluonts.src.gluonts.nursery.tsbench.src.tsbench.surrogate.transformers.config_py.DatasetCatch22Encoder.fit"].
aws-deadline_deadline-cloud
public
public
0
0
split_parameter_args
def split_parameter_args(parameters: list[JobParameter],job_bundle_dir: str,app_name: Optional[str] = None,supported_app_parameter_names: Optional[list[str]] = None,) -> Tuple[dict[str, Any], dict[str, Any]]:"""Splits the input job_bundle_parameters into separate application paramtersand job specific parameters.Args:parameters (list): The list of submission parameters.job_bundle_dir (str): The job bundle directory, used for error messages.app_name (str): The name of the application prefix to accept for application-specificparameters.supported_app_parameter_names (list[str]): The list of parameter namesthat can be provided with the `app_name` prefix."""if app_name is None:app_name = DEFAULT_APP_NAMEif supported_app_parameter_names is None:supported_app_parameter_names = DEFAULT_SUPPORTED_APP_PARAMETER_NAMESjob_parameters: dict[str, Any] = {}app_parameters: dict[str, Any] = {}if parameters:for parameter in parameters:if "value" in parameter:parameter_name = parameter["name"]parameter_value = parameter["value"]if parameter_name.startswith(f"{app_name}:"):# Application-specific parametersapp_parameter_name = parameter_name.split(":", 1)[1]if app_parameter_name in supported_app_parameter_names:app_parameters[app_parameter_name] = parameter_valueelse:raise DeadlineOperationError(f"Unrecognized parameter named {parameter_name!r} from job bundle:\n{job_bundle_dir}")elif ":" in parameter_name:# Drop application-specific parameters from other applicationspasselse:parameter_type = parameter["type"].lower()job_parameters[parameter_name] = {parameter_type: str(parameter_value)}return app_parameters, job_parameters
9
31
4
193
6
102
151
102
parameters,job_bundle_dir,app_name,supported_app_parameter_names
['parameter_type', 'app_parameter_name', 'supported_app_parameter_names', 'parameter_name', 'parameter_value', 'app_name']
Tuple[dict[str, Any], dict[str, Any]]
{"AnnAssign": 2, "Assign": 8, "Expr": 1, "For": 1, "If": 7, "Return": 1}
5
50
5
["parameter_name.startswith", "parameter_name.split", "DeadlineOperationError", "lower", "str"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle"]
The function (split_parameter_args) defined within the public class called public.The function start at line 102 and ends at 151. It contains 31 lines of code and it has a cyclomatic complexity of 9. It takes 4 parameters, represented as [102.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions called inside which are ["parameter_name.startswith", "parameter_name.split", "DeadlineOperationError", "lower", "str"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.api._submit_job_bundle_py.create_job_from_job_bundle"].
aws-deadline_deadline-cloud
public
public
0
0
block_signals
def block_signals(element):"""Context manager used to turn off signals for a UI element."""old_value = element.blockSignals(True)try:yieldfinally:element.blockSignals(old_value)
2
6
1
25
1
9
17
9
element
['old_value']
None
{"Assign": 1, "Expr": 3, "Try": 1}
2
9
2
["element.blockSignals", "element.blockSignals"]
18
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._build_general_settings_ui", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._fill_aws_profiles_box", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_checkbox_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting_with_tooltips", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget.refresh", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.clear_list", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.handle_background_exception", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.handle_list_update", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.refresh_list", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.refresh_selected_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_job_template_parameter_changed", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_shared_job_parameter_changed", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_attachments_tab_py.JobAttachmentsWidget._set_attachments_list", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py.DirectoryPickerWidget.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py.DirectoryPickerWidget.setText", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py._FileWidget.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py._FileWidget.setText"]
The function (block_signals) defined within the public class called public.The function start at line 9 and ends at 17. 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. It declares 2.0 functions, It has 2.0 functions called inside which are ["element.blockSignals", "element.blockSignals"], It has 18.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._build_general_settings_ui", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._fill_aws_profiles_box", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_checkbox_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget._init_combobox_setting_with_tooltips", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py.DeadlineWorkstationConfigWidget.refresh", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.clear_list", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.handle_background_exception", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.handle_list_update", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.refresh_list", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.deadline_config_dialog_py._DeadlineResourceListComboBox.refresh_selected_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_job_template_parameter_changed", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dialogs.submit_job_to_deadline_dialog_py.SubmitJobToDeadlineDialog.on_shared_job_parameter_changed", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.job_attachments_tab_py.JobAttachmentsWidget._set_attachments_list", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py.DirectoryPickerWidget.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py.DirectoryPickerWidget.setText", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py._FileWidget.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.widgets.path_widgets_py._FileWidget.setText"].
aws-deadline_deadline-cloud
public
public
0
0
gui_error_handler
def gui_error_handler(message_title: str, parent: Any = None):"""A context manager that initializes a Qt GUI context thatcatches errors and shows them in a message box instead ofpunting them to a CLI interface.For example:with gui_context():from deadline.client.ui.cli_job_submitter import show_cli_job_submittershow_cli_job_submitter()"""try:from qtpy.QtWidgets import QMessageBoxyieldexcept DeadlineOperationError as e:QMessageBox.warning(parent, message_title, str(e))# type: ignore[call-arg]except Exception:import tracebackQMessageBox.warning(parent, message_title, f"Exception caught:\n{traceback.format_exc()}")# type: ignore[call-arg]
3
9
2
57
0
21
44
21
message_title,parent
[]
None
{"Expr": 4, "Try": 1}
4
24
4
["QMessageBox.warning", "str", "QMessageBox.warning", "traceback.format_exc"]
0
[]
The function (gui_error_handler) defined within the public class called public.The function start at line 21 and ends at 44. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [21.0] and does not return any value. It declares 4.0 functions, and It has 4.0 functions called inside which are ["QMessageBox.warning", "str", "QMessageBox.warning", "traceback.format_exc"].
aws-deadline_deadline-cloud
public
public
0
0
gui_context_for_cli
def gui_context_for_cli(automatically_install_dependencies: bool):"""A context manager that initializes a Qt GUI context forthe CLI handler to use.For example:with gui_context_for_cli(automatically_install_dependencies) as app:from deadline.client.ui.cli_job_submitter import show_cli_job_submittershow_cli_job_submitter()app.exec()If automatically_install_dependencies is true, dependencies will be installed without prompting the user. Usefulif the command is triggered not from a command line."""import importlibimport osfrom os.path import basename, dirname, join, normpathimport shleximport shutilimport subprocessimport sysfrom pathlib import Pathimport clickhas_pyside6 = importlib.util.find_spec("PySide6")has_pyside2 = importlib.util.find_spec("PySide2")if not (has_pyside6 or has_pyside2):if not automatically_install_dependencies:message = "Optional GUI components for deadline are unavailable. Would you like to install PySide?"will_install_gui = click.confirm(message, default=False)if not will_install_gui:click.echo("Unable to continue without GUI, exiting")sys.exit(1)# this should match what's in the pyproject.tomlpyside6_pypi = "PySide6-essentials >= 6.6,< 6.9"if "deadline" in basename(sys.executable).lower():# running with a deadline executable, not standard python.# So exit the deadline folder into the main deps dirdeps_folder = normpath(join(dirname(__file__),"..","..","..",))runtime_version = f"{sys.version_info.major}.{sys.version_info.minor}"pip_command = ["-m","pip","install",pyside6_pypi,"--python-version",runtime_version,"--only-binary=:all:","-t",deps_folder,]python_executable = shutil.which("python3") or shutil.which("python")if python_executable:command = " ".join(shlex.quote(v) for v in [python_executable] + pip_command)subprocess.run([python_executable] + pip_command)else:click.echo("Unable to install GUI dependencies, if you have python available you can install it by running:")click.echo()click.echo(f"\t{' '.join(shlex.quote(v) for v in ['python'] + pip_command)}")click.echo()sys.exit(1)else:# standard python sys.executable# TODO: swap to deadline[gui]==version once published and at the same# time consider local editables `pip install .[gui]`subprocess.run([sys.executable, "-m", "pip", "install", pyside6_pypi])# set QT_API to inform qtpy which dependencies to look for.# default to pyside6 and fallback to pyside2.# Does not work with PyQt5 which is qtpy defaultos.environ["QT_API"] = "pyside6"if has_pyside2:os.environ["QT_API"] = "pyside2"try:from qtpy.QtGui import QIconfrom qtpy.QtWidgets import QApplication, QMessageBoxexcept ImportError as e:click.echo(f"Failed to import qtpy/PySide/Qt, which is required to show the GUI:\n{e}")sys.exit(1)try:app = QApplication(sys.argv)app.setApplicationName("AWS Deadline Cloud")icon = QIcon(str(Path(__file__).parent.parent / "ui" / "resources" / "deadline_logo.svg"))app.setWindowIcon(icon)yield appexcept DeadlineOperationError as e:import osimport shlexcommand = f"{os.path.basename(sys.argv[0])} " + " ".join(shlex.quote(v) for v in sys.argv[1:])QMessageBox.warning(None, f'Error running "{command}"', str(e))# type: ignore[call-overload, call-arg, arg-type]except Exception:import osimport shleximport tracebackcommand = f"{os.path.basename(sys.argv[0])} " + " ".join(shlex.quote(v) for v in sys.argv[1:])QMessageBox.warning(# type: ignore[call-overload, call-arg]None,# type: ignore[arg-type]f'Error running "{command}"',f"Exception caught:\n{traceback.format_exc()}",)
15
89
1
459
12
48
169
48
automatically_install_dependencies
['has_pyside2', 'has_pyside6', 'app', 'command', 'icon', 'pip_command', 'deps_folder', 'will_install_gui', 'runtime_version', 'message', 'python_executable', 'pyside6_pypi']
None
{"Assign": 16, "Expr": 17, "If": 6, "Try": 2}
41
122
41
["importlib.util.find_spec", "importlib.util.find_spec", "click.confirm", "click.echo", "sys.exit", "lower", "basename", "normpath", "join", "dirname", "shutil.which", "shutil.which", "join", "shlex.quote", "subprocess.run", "click.echo", "click.echo", "click.echo", "join", "shlex.quote", "click.echo", "sys.exit", "subprocess.run", "click.echo", "sys.exit", "QApplication", "app.setApplicationName", "QIcon", "str", "Path", "app.setWindowIcon", "os.path.basename", "join", "shlex.quote", "QMessageBox.warning", "str", "os.path.basename", "join", "shlex.quote", "QMessageBox.warning", "traceback.format_exc"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.bundle_group_py.bundle_gui_submit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.config_group_py.config_gui"]
The function (gui_context_for_cli) defined within the public class called public.The function start at line 48 and ends at 169. It contains 89 lines of code and it has a cyclomatic complexity of 15. The function does not take any parameters and does not return any value. It declares 41.0 functions, It has 41.0 functions called inside which are ["importlib.util.find_spec", "importlib.util.find_spec", "click.confirm", "click.echo", "sys.exit", "lower", "basename", "normpath", "join", "dirname", "shutil.which", "shutil.which", "join", "shlex.quote", "subprocess.run", "click.echo", "click.echo", "click.echo", "join", "shlex.quote", "click.echo", "sys.exit", "subprocess.run", "click.echo", "sys.exit", "QApplication", "app.setApplicationName", "QIcon", "str", "Path", "app.setWindowIcon", "os.path.basename", "join", "shlex.quote", "QMessageBox.warning", "str", "os.path.basename", "join", "shlex.quote", "QMessageBox.warning", "traceback.format_exc"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.bundle_group_py.bundle_gui_submit", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.cli._groups.config_group_py.config_gui"].
aws-deadline_deadline-cloud
CancelationFlag
public
0
0
__init__
def __init__(self):self.canceled = False
1
2
1
10
0
195
196
195
self
[]
None
{"Assign": 1}
0
2
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_py.TgScheduler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.CalculatedAmountDiscrepancyError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ExchangeRateMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.InvalidTransactionError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ParsingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.PriceMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.QuantityNotPositiveError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.SymbolMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedColumnCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedRowCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.raw_py.RawTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.trading212_py.Trading212Transaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.vanguard_py.VanguardTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.ExporterError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordFileDoesNotExistError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordTooLongError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.DeviceInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HomeAutomation.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostNumberOfEntries.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.LanInterfaceConfig.__init__"]
The function (__init__) defined within the public class called CancelationFlag.The function start at line 195 and ends at 196. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 4993.0 functions calling this function which are ["_.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_py.TgScheduler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.CalculatedAmountDiscrepancyError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ExchangeRateMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.InvalidTransactionError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.ParsingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.PriceMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.QuantityNotPositiveError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.SymbolMissingError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedColumnCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.UnexpectedRowCountError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.raw_py.RawTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_equity_award_json_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.schwab_py.SchwabTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.trading212_py.Trading212Transaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.parsers.vanguard_py.VanguardTransaction.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.ExporterError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordFileDoesNotExistError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.config.exceptions_py.FritzPasswordTooLongError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.DeviceInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HomeAutomation.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostInfo.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.HostNumberOfEntries.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18106662_pdreker_fritz_exporter.fritzexporter.fritzcapabilities_py.LanInterfaceConfig.__init__"].
aws-deadline_deadline-cloud
CancelationFlag
public
0
0
set_canceled
def set_canceled(self):self.canceled = True
1
2
1
10
0
198
199
198
self
[]
None
{"Assign": 1}
0
2
0
[]
0
[]
The function (set_canceled) defined within the public class called CancelationFlag.The function start at line 198 and ends at 199. 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
CancelationFlag
public
0
0
__bool__
def __bool__(self):return self.canceled
1
2
1
9
0
201
202
201
self
[]
Returns
{"Return": 1}
0
2
0
[]
0
[]
The function (__bool__) defined within the public class called CancelationFlag.The function start at line 201 and ends at 202. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value..
aws-deadline_deadline-cloud
public
public
0
0
show_cli_job_submitter.on_create_job_bundle_callback
def on_create_job_bundle_callback(widget: SubmitJobToDeadlineDialog,job_bundle_dir: str,settings: CliJobSettings,queue_parameters: list[JobParameter],asset_references: AssetReferences,host_requirements: Optional[Dict[str, Any]] = None,purpose: JobBundlePurpose = JobBundlePurpose.SUBMISSION,) -> dict[str, Any]:"""Perform a submission when the submit button is pressedArgs:widget (SubmitJobToDeadlineDialog): The Deadline job submission dialog.settings (CliJobSettings): A settings object that was populated from the job submission dialog.job_bundle_dir (str): The directory within which to create the job bundle.asset_references (FlatAssetReferences): The input from the attachments provided duringconstruction and the user's input in the Job Attachments tab."""if settings.file_format not in ("YAML", "JSON"):raise RuntimeError(f"The CLI Job Submitter only supports YAML and JSON output, not {settings.file_format!r}.")job_template: Dict[str, Any] = {"specificationVersion": "jobtemplate-2023-09","name": settings.name,}if settings.description:job_template["description"] = settings.descriptionjob_template["parameterDefinitions"] = [{"name": "DataDir","type": "PATH","objectType": "DIRECTORY","dataFlow": "INOUT",}]step = {"name": "CliScript","script": {"actions": {"onRun": {"command": "{{Task.File.runScript}}",}},"embeddedFiles": [{"name": "runScript","type": "TEXT","runnable": True,"data": settings.bash_script_contents,}],},}job_template["steps"] = [step]if settings.use_array_parameter:job_array_parameter_name = f"{settings.array_parameter_name}Values"job_template["parameterDefinitions"].append({"name": job_array_parameter_name,"type": "STRING","default": settings.array_parameter_values,})step["parameterSpace"] = {"taskParameterDefinitions": [{"name": settings.array_parameter_name,"type": "INT","range": "{{Param." + job_array_parameter_name + "}}",}]}# If "HostRequirements" is provided, inject it into each of the "Step"if host_requirements:# for each step in the template, append the same host requirements.for step in job_template["steps"]:step["hostRequirements"] = copy.deepcopy(host_requirements)with open(os.path.join(job_bundle_dir, f"template.{settings.file_format.lower()}"),"w",encoding="utf8",) as f:if settings.file_format == "YAML":deadline_yaml_dump(job_template, f)elif settings.file_format == "JSON":json.dump(job_template, f, sort_keys=False, indent=1)# Filter the provided queue parameters to just their valuesparameters_values = [{"name": param["name"], "value": param["value"]} for param in queue_parameters]with open(os.path.join(job_bundle_dir, f"parameter_values.{settings.file_format.lower()}"),"w",encoding="utf8",) as f:if settings.file_format == "YAML":deadline_yaml_dump({"parameterValues": parameters_values}, f)elif settings.file_format == "JSON":json.dump({"parameterValues": parameters_values}, f, indent=1)if asset_references:with open(os.path.join(job_bundle_dir, f"asset_references.{settings.file_format.lower()}"),"w",encoding="utf8",) as f:if settings.file_format == "YAML":deadline_yaml_dump(asset_references.to_dict(), f)elif settings.file_format == "JSON":json.dump(asset_references.to_dict(), f, indent=1)return {"known_asset_paths": [settings.data_dir],"job_parameters": [{"name": "DataDir", "value": settings.data_dir}],}
14
102
7
523
0
49
170
49
null
[]
None
null
0
0
0
null
0
null
The function (show_cli_job_submitter.on_create_job_bundle_callback) defined within the public class called public.The function start at line 49 and ends at 170. It contains 102 lines of code and it has a cyclomatic complexity of 14. It takes 7 parameters, represented as [49.0] and does not return any value..
aws-deadline_deadline-cloud
public
public
0
0
show_cli_job_submitter
def show_cli_job_submitter(parent=None, f=Qt.WindowFlags()) -> None:"""Shows an example CLI Job Submitter.Pass f=Qt.Tool if running it within an application context and want itto stay on top."""global __submitter_dialogclose_submitter()if parent is None:# Get the main application window so we can parent ours to itapp = QApplication.instance()parent = [widget for widget in app.topLevelWidgets() if isinstance(widget, QMainWindow)][0]# type: ignore[union-attr]def on_create_job_bundle_callback(widget: SubmitJobToDeadlineDialog,job_bundle_dir: str,settings: CliJobSettings,queue_parameters: list[JobParameter],asset_references: AssetReferences,host_requirements: Optional[Dict[str, Any]] = None,purpose: JobBundlePurpose = JobBundlePurpose.SUBMISSION,) -> dict[str, Any]:"""Perform a submission when the submit button is pressedArgs:widget (SubmitJobToDeadlineDialog): The Deadline job submission dialog.settings (CliJobSettings): A settings object that was populated from the job submission dialog.job_bundle_dir (str): The directory within which to create the job bundle.asset_references (FlatAssetReferences): The input from the attachments provided duringconstruction and the user's input in the Job Attachments tab."""if settings.file_format not in ("YAML", "JSON"):raise RuntimeError(f"The CLI Job Submitter only supports YAML and JSON output, not {settings.file_format!r}.")job_template: Dict[str, Any] = {"specificationVersion": "jobtemplate-2023-09","name": settings.name,}if settings.description:job_template["description"] = settings.descriptionjob_template["parameterDefinitions"] = [{"name": "DataDir","type": "PATH","objectType": "DIRECTORY","dataFlow": "INOUT",}]step = {"name": "CliScript","script": {"actions": {"onRun": {"command": "{{Task.File.runScript}}",}},"embeddedFiles": [{"name": "runScript","type": "TEXT","runnable": True,"data": settings.bash_script_contents,}],},}job_template["steps"] = [step]if settings.use_array_parameter:job_array_parameter_name = f"{settings.array_parameter_name}Values"job_template["parameterDefinitions"].append({"name": job_array_parameter_name,"type": "STRING","default": settings.array_parameter_values,})step["parameterSpace"] = {"taskParameterDefinitions": [{"name": settings.array_parameter_name,"type": "INT","range": "{{Param." + job_array_parameter_name + "}}",}]}# If "HostRequirements" is provided, inject it into each of the "Step"if host_requirements:# for each step in the template, append the same host requirements.for step in job_template["steps"]:step["hostRequirements"] = copy.deepcopy(host_requirements)with open(os.path.join(job_bundle_dir, f"template.{settings.file_format.lower()}"),"w",encoding="utf8",) as f:if settings.file_format == "YAML":deadline_yaml_dump(job_template, f)elif settings.file_format == "JSON":json.dump(job_template, f, sort_keys=False, indent=1)# Filter the provided queue parameters to just their valuesparameters_values = [{"name": param["name"], "value": param["value"]} for param in queue_parameters]with open(os.path.join(job_bundle_dir, f"parameter_values.{settings.file_format.lower()}"),"w",encoding="utf8",) as f:if settings.file_format == "YAML":deadline_yaml_dump({"parameterValues": parameters_values}, f)elif settings.file_format == "JSON":json.dump({"parameterValues": parameters_values}, f, indent=1)if asset_references:with open(os.path.join(job_bundle_dir, f"asset_references.{settings.file_format.lower()}"),"w",encoding="utf8",) as f:if settings.file_format == "YAML":deadline_yaml_dump(asset_references.to_dict(), f)elif settings.file_format == "JSON":json.dump(asset_references.to_dict(), f, indent=1)return {"known_asset_paths": [settings.data_dir],"job_parameters": [{"name": "DataDir", "value": settings.data_dir}],}__submitter_dialog = SubmitJobToDeadlineDialog(job_setup_widget_type=CliJobSettingsWidget,initial_job_settings=CliJobSettings(),initial_shared_parameter_values={},auto_detected_attachments=AssetReferences(),attachments=AssetReferences(),show_host_requirements_tab=True,on_create_job_bundle_callback=on_create_job_bundle_callback,parent=parent,f=f,)__submitter_dialog.show()
4
19
2
113
6
33
183
33
parent,f
['parent', 'job_array_parameter_name', 'app', 'step', 'parameters_values', '__submitter_dialog']
None
{"AnnAssign": 1, "Assign": 11, "Expr": 11, "For": 1, "If": 12, "Return": 1, "With": 3}
30
151
30
["Qt.WindowFlags", "close_submitter", "QApplication.instance", "app.topLevelWidgets", "isinstance", "RuntimeError", "append", "copy.deepcopy", "open", "os.path.join", "settings.file_format.lower", "deadline_yaml_dump", "json.dump", "open", "os.path.join", "settings.file_format.lower", "deadline_yaml_dump", "json.dump", "open", "os.path.join", "settings.file_format.lower", "deadline_yaml_dump", "asset_references.to_dict", "json.dump", "asset_references.to_dict", "SubmitJobToDeadlineDialog", "CliJobSettings", "AssetReferences", "AssetReferences", "__submitter_dialog.show"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.reload_plugin", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dev_application_py.DevMainWindow.submit_cli_job"]
The function (show_cli_job_submitter) defined within the public class called public.The function start at line 33 and ends at 183. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [33.0] and does not return any value. It declares 30.0 functions, It has 30.0 functions called inside which are ["Qt.WindowFlags", "close_submitter", "QApplication.instance", "app.topLevelWidgets", "isinstance", "RuntimeError", "append", "copy.deepcopy", "open", "os.path.join", "settings.file_format.lower", "deadline_yaml_dump", "json.dump", "open", "os.path.join", "settings.file_format.lower", "deadline_yaml_dump", "json.dump", "open", "os.path.join", "settings.file_format.lower", "deadline_yaml_dump", "asset_references.to_dict", "json.dump", "asset_references.to_dict", "SubmitJobToDeadlineDialog", "CliJobSettings", "AssetReferences", "AssetReferences", "__submitter_dialog.show"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.reload_plugin", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.dev_application_py.DevMainWindow.submit_cli_job"].
aws-deadline_deadline-cloud
public
public
0
0
close_submitter
def close_submitter() -> None:global __submitter_dialogif __submitter_dialog:__submitter_dialog.close()__submitter_dialog = None
2
5
0
19
1
186
191
186
['__submitter_dialog']
None
{"Assign": 1, "Expr": 1, "If": 1}
1
6
1
["__submitter_dialog.close"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.reload_plugin", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.show_cli_job_submitter"]
The function (close_submitter) defined within the public class called public.The function start at line 186 and ends at 191. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside which is ["__submitter_dialog.close"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.reload_plugin", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.show_cli_job_submitter"].
aws-deadline_deadline-cloud
public
public
0
0
_reload_modules
def _reload_modules(mod):# TODO: Put this code where it makes sense"""Recursively reloads all modules in the specified package, in postfix order"""import typeschild_mods = [mfor m in mod.__dict__.values()if isinstance(m, types.ModuleType)and m.__package__and m.__package__.startswith(mod.__package__)]for child in child_mods:_reload_modules(mod=child)reload(mod)
6
12
1
62
1
194
212
194
mod
['child_mods']
None
{"Assign": 1, "Expr": 3, "For": 1}
5
19
5
["mod.__dict__.values", "isinstance", "m.__package__.startswith", "_reload_modules", "reload"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py._reload_modules", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.reload_plugin"]
The function (_reload_modules) defined within the public class called public.The function start at line 194 and ends at 212. It contains 12 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 5.0 functions, It has 5.0 functions called inside which are ["mod.__dict__.values", "isinstance", "m.__package__.startswith", "_reload_modules", "reload"], It has 2.0 functions calling this function which are ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py._reload_modules", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.src.deadline.client.ui.cli_job_submitter_py.reload_plugin"].
aws-deadline_deadline-cloud
public
public
0
0
reload_plugin
def reload_plugin() -> None:# TODO: Put this code where it makes sense"""Designed for interative development without closing the DCCthe submitter is embedded inside. Closes the submitter,reloads the Python modules, and starts the submitter again."""close_submitter()# Reload the AWS Deadline Cloud submitter codeimport deadline_reload_modules(deadline)# Re-open the submittershow_cli_job_submitter()
1
5
0
19
0
215
230
215
[]
None
{"Expr": 4}
3
16
3
["close_submitter", "_reload_modules", "show_cli_job_submitter"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3632606_shaunduncan_helga.helga.plugins.operator_py.operator"]
The function (reload_plugin) defined within the public class called public.The function start at line 215 and ends at 230. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called inside which are ["close_submitter", "_reload_modules", "show_cli_job_submitter"], It has 1.0 function calling this function which is ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3632606_shaunduncan_helga.helga.plugins.operator_py.operator"].