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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pystorm_streamparse | public | public | 0 | 0 | _get_component_ui_detail | def _get_component_ui_detail(env_name, topology_name, component_names, config_file=None):if isinstance(component_names, str):component_names = [component_names]env_name = get_env_config(env_name, config_file=config_file)[0]topology_id = _get_topology_id(env_name, topology_name, config_file=config_file)base_url = "/api/... | 4 | 14 | 4 | 105 | 6 | 155 | 168 | 155 | null | ['detail_urls', 'component_names', 'detail', 'base_url', 'topology_id', 'env_name'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_get_component_ui_detail) defined within the public class called public.The function start at line 155 and ends at 168. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [155.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_all_components | def _print_all_components(env_name, topology_name, config_file=None):topology_ui_detail = _get_topology_ui_detail(env_name, topology_name)spouts = map(lambda spout: (spout["spoutId"], topology_ui_detail.get("spouts", {})))bolts = map(lambda spout: (spout["boltId"], topology_ui_detail.get("bolts", {})))ui_details = _get... | 2 | 19 | 3 | 141 | 5 | 171 | 189 | 171 | null | ['ui_details', 'bolts', 'topology_ui_detail', 'names_and_keys', 'spouts'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_all_components) defined within the public class called public.The function start at line 171 and ends at 189. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [171.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_component_status | def _print_component_status(env_name, topology_name, component_name, ui_detail=None, config_file=None):if not ui_detail:ui_detail = _get_component_ui_detail(env_name, topology_name, component_name, config_file=config_file)_print_component_summary(ui_detail)if ui_detail.get("componentType") == "spout":_print_spout_stats... | 4 | 16 | 5 | 83 | 1 | 192 | 207 | 192 | null | ['ui_detail'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_component_status) defined within the public class called public.The function start at line 192 and ends at 207. It contains 16 lines of code and it has a cyclomatic complexity of 4. It takes 5 parameters, represented as [192.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_component_summary | def _print_component_summary(ui_detail):columns = ["id", "name", "executors", "tasks"]print_stats_table("Component summary", ui_detail, columns, "r") | 1 | 3 | 1 | 26 | 1 | 210 | 212 | 210 | null | ['columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_component_summary) defined within the public class called public.The function start at line 210 and ends at 212. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_bolt_stats | def _print_bolt_stats(ui_detail):columns = ["windowPretty","emitted","transferred","executeLatency","executed","processLatency","acked","failed",]print_stats_table("Bolt stats", ui_detail["boltStats"], columns, "r", {"windowPretty": "l"}) | 1 | 14 | 1 | 44 | 1 | 215 | 229 | 215 | null | ['columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_bolt_stats) defined within the public class called public.The function start at line 215 and ends at 229. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_input_stats | def _print_input_stats(ui_detail):columns = ["component","stream","executeLatency","processLatency","executed","acked","failed",]if ui_detail["inputStats"]:print_stats_table("Input stats (All time)",ui_detail["inputStats"],columns,"r",{"component": "l"},) | 2 | 18 | 1 | 49 | 1 | 232 | 249 | 232 | null | ['columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_input_stats) defined within the public class called public.The function start at line 232 and ends at 249. It contains 18 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_bolt_output_stats | def _print_bolt_output_stats(ui_detail):if ui_detail["outputStats"]:columns = ["stream", "emitted", "transferred"]print_stats_table("Output stats (All time)",ui_detail["outputStats"],columns,"r",{"stream": "l"},) | 2 | 10 | 1 | 40 | 1 | 252 | 261 | 252 | null | ['columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_bolt_output_stats) defined within the public class called public.The function start at line 252 and ends at 261. It contains 10 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _print_spout_stats | def _print_spout_stats(ui_detail):columns = ["windowPretty","emitted","transferred","completeLatency","acked","failed",]data = ui_detail["spoutSummary"][-1].copy()print_stats_table("Spout stats", data, columns, "r", {"windowPretty": "l"}) | 1 | 11 | 1 | 51 | 2 | 264 | 274 | 264 | null | ['data', 'columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_spout_stats) defined within the public class called public.The function start at line 264 and ends at 274. 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.. |
pystorm_streamparse | public | public | 0 | 0 | _print_spout_output_stats | def _print_spout_output_stats(ui_detail):columns = ["stream", "emitted", "transferred", "completeLatency", "acked", "failed"]print_stats_table("Output stats (All time)",ui_detail["outputStats"],columns,"r",{"stream": "l"},) | 1 | 9 | 1 | 40 | 1 | 277 | 285 | 277 | null | ['columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_spout_output_stats) defined within the public class called public.The function start at line 277 and ends at 285. 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.. |
pystorm_streamparse | public | public | 0 | 0 | _print_spout_executors | def _print_spout_executors(ui_detail):columns = ["id","uptime","host","port","emitted","transferred","completeLatency","acked","failed",]print_stats_table("Executors (All time)", ui_detail["executorStats"], columns, "r", {"host": "l"}) | 1 | 15 | 1 | 46 | 1 | 288 | 302 | 288 | null | ['columns'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_print_spout_executors) defined within the public class called public.The function start at line 288 and ends at 302. It contains 15 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _get_topology_id | def _get_topology_id(env_name, topology_name, config_file=None):"""Get toplogy ID from summary json provided by UI api"""summary_url = "/api/v1/topology/summary"topology_summary = get_ui_json(env_name, summary_url, config_file=config_file)for topology in topology_summary["topologies"]:if topology_name == topology["name... | 3 | 6 | 3 | 48 | 2 | 305 | 311 | 305 | null | ['topology_summary', 'summary_url'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_get_topology_id) defined within the public class called public.The function start at line 305 and ends at 311. It contains 6 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [305.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | subparser_hook | def subparser_hook(subparsers):""" Hook to add subparser for this command. """subparser = subparsers.add_parser("stats", description=__doc__, help=main.__doc__)subparser.set_defaults(func=main)subparser.add_argument("--all", action="store_true", help="All available stats.")subparser.add_argument("-c","--component",help... | 1 | 13 | 1 | 72 | 1 | 314 | 327 | 314 | null | ['subparser'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (subparser_hook) defined within the public class called public.The function start at line 314 and ends at 327. It contains 13 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | main | def main(args):""" Display stats about running Storm topologies. """storm_version = storm_lib_version()if storm_version >= parse_version("0.9.2-incubating"):display_stats(args.environment,topology_name=args.name,component_name=args.component,all_components=args.all,config_file=args.config,)else:print(f"ERROR: Storm {st... | 2 | 13 | 1 | 64 | 1 | 330 | 343 | 330 | null | ['storm_version'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (main) defined within the public class called public.The function start at line 330 and ends at 343. It contains 13 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | get_user_tasks | def get_user_tasks():"""Get tasks defined in a user's tasks.py and fabfile.py file which isassumed to be in the current working directory.:returns: a `tuple` (invoke_tasks, fabric_tasks)"""sys.path.insert(0, os.getcwd())try:user_invoke = importlib.import_module("tasks")except ImportError:user_invoke = Nonetry:user_fabr... | 3 | 11 | 0 | 55 | 2 | 57 | 72 | 57 | null | ['user_invoke', 'user_fabric'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (get_user_tasks) defined within the public class called public.The function start at line 57 and ends at 72. It contains 11 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | is_safe_to_submit | def is_safe_to_submit(topology_name, nimbus_client):"""Is topology not in list of current topologies?"""topologies = _list_topologies(nimbus_client)safe = not any(topology.name == topology_name for topology in topologies)return safe | 2 | 4 | 2 | 31 | 2 | 75 | 79 | 75 | null | ['safe', 'topologies'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (is_safe_to_submit) defined within the public class called public.The function start at line 75 and ends at 79. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [75.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _kill_existing_topology | def _kill_existing_topology(topology_name, force, wait, nimbus_client):if force and not is_safe_to_submit(topology_name, nimbus_client):print(f'Killing current "{topology_name}" topology.')sys.stdout.flush()_kill_topology(topology_name, nimbus_client, wait=wait)while not is_safe_to_submit(topology_name, nimbus_client):... | 4 | 11 | 4 | 84 | 0 | 82 | 92 | 82 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_kill_existing_topology) defined within the public class called public.The function start at line 82 and ends at 92. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [82.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _submit_topology | def _submit_topology(topology_name,topology_class,remote_jar_path,config,env_config,nimbus_client,options=None,active=True,):if options.get("pystorm.log.path"):print(f"Routing Python logging to {options['pystorm.log.path']}.")sys.stdout.flush()set_topology_serializer(env_config, config, topology_class)# Check if topolo... | 5 | 33 | 8 | 151 | 2 | 95 | 131 | 95 | null | ['submit_options', 'initial_status'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_submit_topology) defined within the public class called public.The function start at line 95 and ends at 131. It contains 33 lines of code and it has a cyclomatic complexity of 5. It takes 8 parameters, represented as [95.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _pre_submit_hooks | def _pre_submit_hooks(topology_name, env_name, env_config, options):"""Pre-submit hooks for invoke and fabric."""user_invoke, user_fabric = get_user_tasks()pre_submit_invoke = getattr(user_invoke, "pre_submit", None)if callable(pre_submit_invoke):pre_submit_invoke(topology_name, env_name, env_config, options)pre_submit... | 3 | 8 | 4 | 71 | 2 | 134 | 142 | 134 | null | ['pre_submit_invoke', 'pre_submit_fabric'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_pre_submit_hooks) defined within the public class called public.The function start at line 134 and ends at 142. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [134.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _post_submit_hooks | def _post_submit_hooks(topology_name, env_name, env_config, options):"""Post-submit hooks for invoke and fabric."""user_invoke, user_fabric = get_user_tasks()post_submit_invoke = getattr(user_invoke, "post_submit", None)if callable(post_submit_invoke):post_submit_invoke(topology_name, env_name, env_config, options)post... | 3 | 8 | 4 | 71 | 2 | 145 | 153 | 145 | null | ['post_submit_fabric', 'post_submit_invoke'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_post_submit_hooks) defined within the public class called public.The function start at line 145 and ends at 153. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [145.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _upload_jar | def _upload_jar(nimbus_client, local_path):upload_location = nimbus_client.beginFileUpload()print(f"Uploading topology jar {local_path} to assigned location: {upload_location}")total_bytes = os.path.getsize(local_path)bytes_uploaded = 0with open(local_path, "rb") as local_jar:while True:print(f"Uploaded {bytes_uploaded... | 3 | 20 | 2 | 108 | 4 | 156 | 175 | 156 | null | ['bytes_uploaded', 'upload_location', 'total_bytes', 'curr_chunk'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_upload_jar) defined within the public class called public.The function start at line 156 and ends at 175. It contains 20 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [156.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | submit_topology | def submit_topology(name=None,env_name=None,options=None,force=False,wait=None,simple_jar=True,override_name=None,requirements_paths=None,local_jar_path=None,remote_jar_path=None,timeout=None,config_file=None,overwrite_virtualenv=False,user=None,active=True,):"""Submit a topology to a remote Storm cluster."""warn_about... | 20 | 98 | 15 | 525 | 14 | 178 | 300 | 178 | null | ['nimbus_client', 'config', 'virtualenv_name', 'inner_shell', 'streamparse_run_path', 'topology_class', 'override_name', 'local_jar_path', 'remote_jar_path', 'install_venv', 'par_hint', 'use_venv', 'options', 'simple_jar'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (submit_topology) defined within the public class called public.The function start at line 178 and ends at 300. It contains 98 lines of code and it has a cyclomatic complexity of 20. It takes 15 parameters, represented as [178.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | subparser_hook | def subparser_hook(subparsers):"""Hook to add subparser for this command."""subparser = subparsers.add_parser("submit", description=__doc__, help=main.__doc__)subparser.set_defaults(func=main)add_ackers(subparser)add_config(subparser)add_debug(subparser)add_environment(subparser)subparser.add_argument("-f","--force",ac... | 1 | 61 | 1 | 187 | 1 | 303 | 364 | 303 | null | ['subparser'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (subparser_hook) defined within the public class called public.The function start at line 303 and ends at 364. It contains 61 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | main | def main(args):"""Submit a Storm topology to Nimbus."""env.pool_size = args.pool_sizesubmit_topology(name=args.name,env_name=args.environment,options=args.options,force=args.force,wait=args.wait,simple_jar=args.simple_jar,override_name=args.override_name,requirements_paths=args.requirements,local_jar_path=args.local_ja... | 1 | 18 | 1 | 100 | 0 | 367 | 385 | 367 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (main) defined within the public class called public.The function start at line 367 and ends at 385. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _tail_logs | def _tail_logs(topology_name, pattern, follow, num_lines, is_old_storm):"""Actual task to run tail on all servers in parallel."""ls_cmd = get_logfiles_cmd(topology_name=topology_name, pattern=pattern, is_old_storm=is_old_storm)tail_pipe = f" | xargs tail -n {num_lines}"if follow:tail_pipe += " -f"run(ls_cmd + tail_pipe... | 2 | 8 | 5 | 46 | 2 | 28 | 38 | 28 | null | ['ls_cmd', 'tail_pipe'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_tail_logs) defined within the public class called public.The function start at line 28 and ends at 38. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [28.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | tail_topology | def tail_topology(topology_name=None,env_name=None,pattern=None,follow=False,num_lines=10,override_name=None,config_file=None,):"""Follow (tail -f) the log files on remote Storm workers.Will use the `log_path` and `workers` properties from config.json."""if override_name is not None:topology_name = override_nameelse:to... | 2 | 29 | 7 | 131 | 3 | 41 | 73 | 41 | null | ['nimbus_client', 'topology_name', 'is_old_storm'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (tail_topology) defined within the public class called public.The function start at line 41 and ends at 73. It contains 29 lines of code and it has a cyclomatic complexity of 2. It takes 7 parameters, represented as [41.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | subparser_hook | def subparser_hook(subparsers):""" Hook to add subparser for this command. """subparser = subparsers.add_parser("tail", description=__doc__, help=main.__doc__)subparser.set_defaults(func=main)add_config(subparser)add_environment(subparser)subparser.add_argument("-f","--follow",action="store_true",help="Keep files open ... | 1 | 25 | 1 | 94 | 1 | 76 | 101 | 76 | null | ['subparser'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (subparser_hook) defined within the public class called public.The function start at line 76 and ends at 101. It contains 25 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | main | def main(args):""" Tail logs for specified Storm topology. """env.pool_size = args.pool_sizetail_topology(topology_name=args.name,env_name=args.environment,pattern=args.pattern,follow=args.follow,num_lines=args.num_lines,override_name=args.override_name,config_file=args.config,) | 1 | 11 | 1 | 58 | 0 | 104 | 115 | 104 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (main) defined within the public class called public.The function start at line 104 and ends at 115. 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.. |
pystorm_streamparse | public | public | 0 | 0 | _create_or_update_virtualenv | def _create_or_update_virtualenv(virtualenv_root,virtualenv_name,requirements_paths,virtualenv_flags=None,overwrite_virtualenv=False,user=None,):with show("output"):virtualenv_path = "/".join((virtualenv_root, virtualenv_name))if overwrite_virtualenv:puts(f"Removing virtualenv if it exists in {virtualenv_root}")cmd = f... | 6 | 39 | 6 | 194 | 7 | 37 | 79 | 37 | null | ['virtualenv_flags', 'cmd', 'requirements_paths', 'temp_req', 'pip_path', 'virtualenv_path', 'temp_req_paths'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_create_or_update_virtualenv) defined within the public class called public.The function start at line 37 and ends at 79. It contains 39 lines of code and it has a cyclomatic complexity of 6. It takes 6 parameters, represented as [37.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | create_or_update_virtualenvs | def create_or_update_virtualenvs(env_name,topology_name,options,virtualenv_name=None,requirements_paths=None,config_file=None,overwrite_virtualenv=False,user=None,):"""Create or update virtualenvs on remote servers.Assumes that virtualenv is on the path of the remote server(s).:param env_name: the name of the environme... | 8 | 50 | 8 | 224 | 6 | 82 | 154 | 82 | null | ['config', 'storm_options', 'virtualenv_name', 'topology_class', 'requirements_paths', 'found_streamparse'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (create_or_update_virtualenvs) defined within the public class called public.The function start at line 82 and ends at 154. It contains 50 lines of code and it has a cyclomatic complexity of 8. It takes 8 parameters, represented as [82.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | subparser_hook | def subparser_hook(subparsers):"""Hook to add subparser for this command."""subparser = subparsers.add_parser("update_virtualenv", description=__doc__, help=main.__doc__)subparser.set_defaults(func=main)add_config(subparser)add_environment(subparser)add_overwrite_virtualenv(subparser)add_name(subparser)add_options(subp... | 1 | 14 | 1 | 68 | 1 | 157 | 171 | 157 | null | ['subparser'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (subparser_hook) defined within the public class called public.The function start at line 157 and ends at 171. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | main | def main(args):"""Create or update a virtualenv on Storm workers."""env.pool_size = args.pool_sizecreate_or_update_virtualenvs(args.environment,args.name,args.options,virtualenv_name=args.override_name,requirements_paths=args.requirements,config_file=args.config,overwrite_virtualenv=args.overwrite_virtualenv,) | 1 | 11 | 1 | 52 | 0 | 174 | 185 | 174 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (main) defined within the public class called public.The function start at line 174 and ends at 185. 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.. |
pystorm_streamparse | public | public | 0 | 0 | to_graphviz | def to_graphviz(topology_class, node_attr=None, edge_attr=None, **kwargs):"""Convert a Topology into a DiGraph"""if not HAVE_GRAPHVIZ:raise ImportError("The visualize command requires the `graphviz` Python"" library and `graphviz` system library to be ""installed.")attributes = {"fontsize": "16","fontcolor": "white","b... | 8 | 57 | 4 | 322 | 11 | 24 | 85 | 24 | null | ['outputs', 'g', 'edge_attributes', 'sametail_nodes', 'parent', 'sametail', 'all_specs', 'shape', 'attributes', 'label', 'node_attributes'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (to_graphviz) defined within the public class called public.The function start at line 24 and ends at 85. It contains 57 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [24.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _get_display_cls | def _get_display_cls(format):"""Get the appropriate IPython display class for `format`.Returns `IPython.display.SVG` if format=='svg', otherwise`IPython.display.Image`.If IPython is not importable, return dummy function that swallows itsarguments and returns None."""dummy = lambda *args, **kwargs: Nonetry:import IPytho... | 5 | 14 | 1 | 69 | 1 | 88 | 115 | 88 | null | ['dummy'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_get_display_cls) defined within the public class called public.The function start at line 88 and ends at 115. It contains 14 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | visualize_topology | def visualize_topology(name=None, filename=None, format=None, **kwargs):"""Render a topology graph using dot.If `filename` is not None, write a file to disk with that name in theformat specified by `format`.`filename` should not include an extension.Parameters----------name : strThe name of the topology to display.file... | 8 | 28 | 4 | 194 | 8 | 118 | 186 | 118 | null | ['display_cls', 'g', 'fmts', 'full_filename', 'topology_class', 'format', 'filename', 'data'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (visualize_topology) defined within the public class called public.The function start at line 118 and ends at 186. It contains 28 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [118.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | subparser_hook | def subparser_hook(subparsers):""" Hook to add subparser for this command. """subparser = subparsers.add_parser("visualize", description=__doc__, help=main.__doc__)subparser.set_defaults(func=main)add_name(subparser)subparser.add_argument("-f", "--format", help="File extension for graph file. Defaults to PNG")subparser... | 1 | 12 | 1 | 60 | 1 | 189 | 201 | 189 | null | ['subparser'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (subparser_hook) defined within the public class called public.The function start at line 189 and ends at 201. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | main | def main(args):"""Create a Graphviz visualization of the topology"""visualize_topology(name=args.name, format=args.format, filename=args.output_file) | 1 | 2 | 1 | 26 | 0 | 204 | 206 | 204 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (main) defined within the public class called public.The function start at line 204 and ends at 206. 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.. |
pystorm_streamparse | public | public | 0 | 0 | subparser_hook | def subparser_hook(subparsers):""" Hook to add subparser for this command. """subparser = subparsers.add_parser("worker_uptime", description=__doc__, help=main.__doc__)subparser.set_defaults(func=main)add_config(subparser)add_environment(subparser) | 1 | 7 | 1 | 40 | 1 | 11 | 18 | 11 | null | ['subparser'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (subparser_hook) defined within the public class called public.The function start at line 11 and ends at 18. 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.. |
pystorm_streamparse | public | public | 0 | 0 | display_worker_uptime | def display_worker_uptime(env_name, config_file=None):topology_summary_path = "/api/v1/topology/summary"topology_detail_path = "/api/v1/topology/{topology}"component_path = "/api/v1/topology/{topology}/component/{component}"topo_summary_json = get_ui_json(env_name, topology_summary_path, config_file=config_file)topolog... | 10 | 43 | 2 | 251 | 12 | 21 | 67 | 21 | null | ['topology_detail_jsons', 'worker_stats', 'bolts', 'topology_components', 'topology_detail_json', 'topo_summary_json', 'spouts', 'topology_ids', 'topology_detail_path', 'component_path', 'topology_summary_path', 'comp_details'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (display_worker_uptime) defined within the public class called public.The function start at line 21 and ends at 67. It contains 43 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [21.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | main | def main(args):""" Display uptime for Storm workers. """storm_version = storm_lib_version()if storm_version >= parse_version("0.9.2-incubating"):display_worker_uptime(args.environment, config_file=args.config)else:print(f"ERROR: Storm {storm_version} does not support this command.") | 2 | 6 | 1 | 38 | 1 | 70 | 76 | 70 | null | ['storm_version'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (main) defined within the public class called public.The function start at line 70 and ends at 76. 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.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self,component_cls,name=None,command=None,script=None,inputs=None,par=1,config=None,outputs=None,):super().__init__(component_cls,name=name,inputs=inputs,par=par,config=config,outputs=outputs,command=command,script=script,) | 1 | 21 | 9 | 73 | 0 | 10 | 30 | 10 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 10 and ends at 30. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 9 parameters, represented as [10.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self,component_cls,name=None,serialized_java=None,full_class_name=None,args_list=None,inputs=None,par=1,config=None,outputs=None,):super().__init__(component_cls,name=name,serialized_java=serialized_java,inputs=inputs,par=par,config=config,outputs=outputs,full_class_name=full_class_name,args_list=args_list... | 1 | 23 | 10 | 81 | 0 | 34 | 56 | 34 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 34 and ends at 56. It contains 23 lines of code and it has a cyclomatic complexity of 1. It takes 10 parameters, represented as [34.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self, component_cls, name=None, inputs=None, par=1, config=None, outputs=None):self.component_cls = component_clsself.name = nameself.par = self._sanitize_par(component_cls, par)self.config = self._sanitize_config(component_cls, config)self.outputs = self._sanitize_outputs(component_cls, outputs)self.input... | 1 | 15 | 7 | 114 | 0 | 30 | 44 | 30 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 30 and ends at 44. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [30.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _sanitize_par | def _sanitize_par(component_cls, par):""" Raises exceptions if `par` value is not a positive integer. """if par is None:par = component_cls.parif isinstance(par, dict):for stage, par_hint in par.items():if not (isinstance(stage, str) and isinstance(par_hint, int)):raise TypeError("If par is a dict, it must map from ""e... | 9 | 27 | 2 | 117 | 0 | 47 | 74 | 47 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_sanitize_par) defined within the public class called public.The function start at line 47 and ends at 74. It contains 27 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [47.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _sanitize_inputs | def _sanitize_inputs(inputs):if isinstance(inputs, dict):for key, val in list(inputs.items()):if not isinstance(key, GlobalStreamId):if isinstance(key, ComponentSpec):inputs[key["default"]] = valdel inputs[key]else:raise TypeError("If inputs is a dict, it is expected to"" map from GlobalStreamId or ""ComponentSpec obje... | 15 | 53 | 1 | 249 | 0 | 77 | 133 | 77 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_sanitize_inputs) defined within the public class called public.The function start at line 77 and ends at 133. It contains 53 lines of code and it has a cyclomatic complexity of 15. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _sanitize_config | def _sanitize_config(component_cls, config):if config is None:config = component_cls.configif isinstance(config, dict):config = json.dumps(config)elif config is None:config = "{}"else:raise TypeError(f"Config must either be a dict or None.Given: {config!r}")return config | 4 | 12 | 2 | 51 | 0 | 136 | 147 | 136 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_sanitize_config) defined within the public class called public.The function start at line 136 and ends at 147. It contains 12 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [136.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _sanitize_outputs | def _sanitize_outputs(component_cls, outputs):if outputs is None:outputs = component_cls.outputsif outputs is None:outputs = []if isinstance(outputs, (list, tuple)):streams = {}for output in outputs:if isinstance(output, Stream):streams[output.name] = StreamInfo(output_fields=output.fields, direct=output.direct)# Strin... | 7 | 28 | 2 | 140 | 0 | 150 | 178 | 150 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_sanitize_outputs) defined within the public class called public.The function start at line 150 and ends at 178. It contains 28 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [150.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __getitem__ | def __getitem__(self, stream):if stream not in self.common.streams:raise KeyError("Invalid stream for {}: {!r}. Valid streams are: ""{}".format(self.name, stream, list(self.common.streams.keys())))# If name is None, because it hasn't been set yet, use object insteadcomponent_id = self.name or selfreturn GlobalStreamId(... | 3 | 8 | 2 | 63 | 0 | 180 | 188 | 180 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__getitem__) defined within the public class called public.The function start at line 180 and ends at 188. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [180.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __repr__ | def __repr__(self):""":returns: A string representation of the Specification. """attr_dict = deepcopy(self.__dict__)component_cls = attr_dict.pop("component_cls")repr_str = f"{self.__class__.__name__}({component_cls.__name__}"for key, val in attr_dict.items():repr_str += f", {key}={val!r}"repr_str += ")"return repr_str | 2 | 8 | 1 | 46 | 0 | 190 | 198 | 190 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__repr__) defined within the public class called public.The function start at line 190 and ends at 198. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self,component_cls,name=None,serialized_java=None,full_class_name=None,args_list=None,inputs=None,par=None,config=None,outputs=None,):super().__init__(component_cls,name=name,inputs=inputs,par=par,config=config,outputs=outputs,)if serialized_java is not None:if isinstance(serialized_java, bytes):comp_objec... | 6 | 38 | 10 | 167 | 0 | 204 | 242 | 204 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 204 and ends at 242. It contains 38 lines of code and it has a cyclomatic complexity of 6. It takes 10 parameters, represented as [204.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self,component_cls,name=None,command=None,script=None,inputs=None,par=1,config=None,outputs=None,):super().__init__(component_cls,name=name,inputs=inputs,par=par,config=config,outputs=outputs,)if not command:raise ValueError("command is required")if script is None:raise TypeError("script must not be None.I... | 3 | 29 | 9 | 108 | 0 | 248 | 276 | 248 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 248 and ends at 276. It contains 29 lines of code and it has a cyclomatic complexity of 3. It takes 9 parameters, represented as [248.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self,component_cls,name=None,command=None,script=None,par=1,config=None,outputs=None,):super().__init__(component_cls,name=name,par=par,config=config,outputs=outputs,command=command,script=script,) | 1 | 19 | 8 | 65 | 0 | 10 | 28 | 10 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 10 and ends at 28. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [10.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self,component_cls,name=None,serialized_java=None,full_class_name=None,args_list=None,par=1,config=None,outputs=None,):super().__init__(component_cls,name=name,par=par,config=config,outputs=outputs,serialized_java=serialized_java,full_class_name=full_class_name,args_list=args_list,) | 1 | 21 | 9 | 73 | 0 | 32 | 52 | 32 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 32 and ends at 52. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 9 parameters, represented as [32.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __init__ | def __init__(self, fields=None, name="default", direct=False):""":param fields: Field names for this stream.:type fields:`list` or `tuple` of `str`:param name: Name of stream.Defaults to ``default``.:type name:`str`:param direct: Whether or not this stream is direct.Default is `False`. See :attr:`~streamparse.dsl.strea... | 7 | 25 | 4 | 120 | 0 | 13 | 46 | 13 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__init__) defined within the public class called public.The function start at line 13 and ends at 46. It contains 25 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [13.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __repr__ | def __repr__(self):for name, val in vars(self).items():if not name.startswith("_") and val is not None:if isinstance(val, NullStruct):return f"{name.upper()}"else:return f"{name}({val!r})" | 5 | 7 | 1 | 49 | 0 | 54 | 60 | 54 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__repr__) defined within the public class called public.The function start at line 54 and ends at 60. It contains 7 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | fields | def fields(cls, *fields):"""The stream is partitioned by the fields specified in the grouping.For example, if the stream is grouped by the `user-id` field, Tupleswith the same `user-id` will always go to the same task, but Tuples withdifferent `user-id`'s may go to different tasks."""if len(fields) == 1 and isinstance(... | 4 | 8 | 2 | 57 | 0 | 107 | 119 | 107 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (fields) defined within the public class called public.The function start at line 107 and ends at 119. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [107.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | custom_object | def custom_object(cls, java_class_name, arg_list):"""Tuples will be assigned to tasks by the given Java class."""java_object = JavaObject(full_class_name=java_class_name,args_list=[to_java_arg(arg) for arg in arg_list],)return _Grouping(custom_object=java_object) | 2 | 6 | 3 | 39 | 0 | 122 | 128 | 122 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (custom_object) defined within the public class called public.The function start at line 122 and ends at 128. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [122.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | custom_serialized | def custom_serialized(cls, java_serialized):"""Tuples will be assigned to tasks by the given Java serialized class."""if not isinstance(java_serialized, bytes):return TypeError("Argument to custom_serialized must be a ""serialized Java class as bytes.Given: {!r}".format(java_serialized))return _Grouping(custom_serializ... | 2 | 7 | 2 | 35 | 0 | 131 | 138 | 131 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (custom_serialized) defined within the public class called public.The function start at line 131 and ends at 138. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [131.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __new__ | def __new__(mcs, classname, bases, class_dict):bolt_specs = {}spout_specs = {}# Copy ComponentSpec items out of class_dictspecs = TopologyType.class_dict_to_specs(class_dict)# Perform checksfor spec in specs.values():if isinstance(spec, (JavaBoltSpec, ShellBoltSpec)):TopologyType.add_bolt_spec(spec, bolt_specs)elif isi... | 8 | 31 | 4 | 198 | 0 | 19 | 51 | 19 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__new__) defined within the public class called public.The function start at line 19 and ends at 51. It contains 31 lines of code and it has a cyclomatic complexity of 8. It takes 4 parameters, represented as [19.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | class_dict_to_specs | def class_dict_to_specs(mcs, class_dict):"""Extract valid `ComponentSpec` entries from `Topology.__dict__`."""specs = {}# Set spec names firstfor name, spec in class_dict.items():if isinstance(spec, ComponentSpec):# Use the variable name as the specification name.if spec.name is None:spec.name = nameif spec.name in spe... | 6 | 17 | 2 | 88 | 0 | 54 | 73 | 54 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (class_dict_to_specs) defined within the public class called public.The function start at line 54 and ends at 73. It contains 17 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [54.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | add_bolt_spec | def add_bolt_spec(mcs, spec, bolt_specs):"""Add valid Bolt specs to `bolt_specs`; raise exceptions for others."""if not spec.inputs:cls_name = spec.component_cls.__name__raise ValueError('{} "{}" requires at least one input, because it '"is a Bolt.".format(cls_name, spec.name))bolt_specs[spec.name] = Bolt(bolt_object=s... | 2 | 10 | 3 | 59 | 0 | 76 | 86 | 76 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (add_bolt_spec) defined within the public class called public.The function start at line 76 and ends at 86. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [76.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | add_spout_spec | def add_spout_spec(mcs, spec, spout_specs):"""Add valid Spout specs to `spout_specs`; raise exceptions for others."""if not spec.outputs:cls_name = spec.component_cls.__name__raise ValueError('{} "{}" requires at least one output, because it '"is a Spout".format(cls_name, spec.name))spout_specs[spec.name] = SpoutSpec(s... | 2 | 10 | 3 | 59 | 0 | 89 | 99 | 89 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (add_spout_spec) defined within the public class called public.The function start at line 89 and ends at 99. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [89.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | clean_spec_inputs | def clean_spec_inputs(mcs, spec, specs):"""Convert `spec.inputs` to a dict mapping from stream IDs to groupings."""if spec.inputs is None:spec.inputs = {}for stream_id, grouping in list(spec.inputs.items()):if isinstance(stream_id.componentId, ComponentSpec):# Have to reinsert key after fix because hash changesdel spec... | 8 | 22 | 3 | 149 | 0 | 102 | 127 | 102 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (clean_spec_inputs) defined within the public class called public.The function start at line 102 and ends at 127. It contains 22 lines of code and it has a cyclomatic complexity of 8. It takes 3 parameters, represented as [102.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | __repr__ | def __repr__(cls):""":returns: A string representation of the topology"""# TODO: Come up with a better repr that makes it clear the class is not# actually a StormTopology objectreturn repr(getattr(cls, "thrift_topology", None)) | 1 | 2 | 1 | 18 | 0 | 129 | 133 | 129 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (__repr__) defined within the public class called public.The function start at line 129 and ends at 133. 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.. |
pystorm_streamparse | public | public | 0 | 0 | write.write_it | def write_it(stream):transport_out = TMemoryBuffer()protocol_out = TBinaryProtocol(transport_out)cls.thrift_topology.write(protocol_out)transport_bytes = transport_out.getvalue()stream.write(transport_bytes) | 1 | 6 | 1 | 37 | 0 | 150 | 155 | 150 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (write.write_it) defined within the public class called public.The function start at line 150 and ends at 155. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | write | def write(cls, stream):"""Write the topology to a stream or file.Typically used to write to Nimbus... note::This will not save the `specs` attribute, as that is not part ofthe Thrift output."""def write_it(stream):transport_out = TMemoryBuffer()protocol_out = TBinaryProtocol(transport_out)cls.thrift_topology.write(prot... | 2 | 7 | 2 | 38 | 0 | 140 | 161 | 140 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (write) defined within the public class called public.The function start at line 140 and ends at 161. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [140.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | read.read_it | def read_it(stream):stream_bytes = stream.read()transport_in = TMemoryBuffer(stream_bytes)protocol_in = TBinaryProtocol(transport_in)topology = StormTopology()topology.read(protocol_in)cls.thrift_topology = topologycls.thrift_bolts = topology.boltscls.thrift_spouts = topology.spouts# Can't reconstruct Python specs from... | 1 | 10 | 1 | 60 | 0 | 172 | 182 | 172 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (read.read_it) defined within the public class called public.The function start at line 172 and ends at 182. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | read | def read(cls, stream):"""Read a topology from a stream or file... note::This will not properly reconstruct the `specs` attribute, as that isnot included in the Thrift output."""def read_it(stream):stream_bytes = stream.read()transport_in = TMemoryBuffer(stream_bytes)protocol_in = TBinaryProtocol(transport_in)topology =... | 2 | 7 | 2 | 40 | 0 | 164 | 188 | 164 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (read) defined within the public class called public.The function start at line 164 and ends at 188. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [164.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _spec_to_flux_dict | def _spec_to_flux_dict(spec):"""Convert a ComponentSpec into a dict as expected by Flux"""flux_dict = {"id": spec.name, "constructorArgs": []}if isinstance(spec, ShellComponentSpec):if isinstance(spec, ShellBoltSpec):flux_dict["className"] = "org.apache.storm.flux.wrappers.bolts.FluxShellBolt"else:flux_dict["className"... | 11 | 55 | 1 | 298 | 0 | 191 | 247 | 191 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_spec_to_flux_dict) defined within the public class called public.The function start at line 191 and ends at 247. It contains 55 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | _stream_to_flux_dict | def _stream_to_flux_dict(spec, global_stream, grouping):"""Convert a GlobalStreamId into a dict as expected by Flux"""flux_dict = {"from": global_stream.componentId, "to": spec.name}grouping_dict = {"streamId": global_stream.streamId}for key, val in grouping.__dict__.items():if val is not None:grouping_dict["type"] = k... | 6 | 20 | 3 | 129 | 0 | 250 | 270 | 250 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_stream_to_flux_dict) defined within the public class called public.The function start at line 250 and ends at 270. It contains 20 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [250.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | to_flux_dict | def to_flux_dict(cls, name):"""Convert topology to dict that can written out as Flux YAML file."""flux_dict = {"name": name, "bolts": [], "spouts": [], "streams": []}for spec in cls.specs:if isinstance(spec, (JavaBoltSpec, ShellBoltSpec)):flux_dict["bolts"].append(cls._spec_to_flux_dict(spec))for global_stream, groupin... | 7 | 18 | 2 | 152 | 0 | 273 | 291 | 273 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (to_flux_dict) defined within the public class called public.The function start at line 273 and ends at 291. It contains 18 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [273.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | to_java_arg | def to_java_arg(arg):"""Converts Python objects to equivalent Thrift JavaObjectArgs"""if isinstance(arg, bool):java_arg = JavaObjectArg(bool_arg=arg)elif isinstance(arg, int):# Just use long all the time since Python 3 doesn't# distinguish between long and intjava_arg = JavaObjectArg(long_arg=arg)elif isinstance(arg, b... | 6 | 18 | 1 | 102 | 1 | 8 | 28 | 8 | null | ['java_arg'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (to_java_arg) defined within the public class called public.The function start at line 8 and ends at 28. It contains 18 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | to_python_arg | def to_python_arg(java_arg):"""Convert a Thrift JavaObjectArg into a basic Python data type"""arg = Nonefor val in java_arg.__dict__.values():if val is not None:arg = valbreakreturn arg | 3 | 7 | 1 | 32 | 1 | 31 | 38 | 31 | null | ['arg'] | None | null | 0 | 0 | 0 | null | 0 | null | The function (to_python_arg) defined within the public class called public.The function start at line 31 and ends at 38. It contains 7 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | to_python_arg_list | def to_python_arg_list(java_arg_list):"""Convert a list of Thrift JavaObjectArg objects into a list of basic types"""return [to_python_arg(java_arg) for java_arg in java_arg_list] | 2 | 2 | 1 | 17 | 0 | 41 | 43 | 41 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (to_python_arg_list) defined within the public class called public.The function start at line 41 and ends at 43. 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.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls,name=None,serialized_java=None,full_class_name=None,args_list=None,inputs=None,par=1,config=None,outputs=None,):"""Create a :class:`JavaBoltSpec` for a Java Bolt.This spec represents this Bolt in a :class:`~streamparse.Topology`.You must add the appropriate entries to your classpath by editing yourproject'... | 1 | 22 | 9 | 77 | 0 | 13 | 79 | 13 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 13 and ends at 79. It contains 22 lines of code and it has a cyclomatic complexity of 1. It takes 9 parameters, represented as [13.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls,name=None,command=None,script=None,inputs=None,par=None,config=None,outputs=None,):"""Create a :class:`ShellBoltSpec` for a non-Java, non-Python Bolt.If you want to create a spec for a Python Bolt, use:meth:`~streamparse.dsl.bolt.Bolt.spec`.This spec represents this Bolt in a :class:`~streamparse.Topology`... | 1 | 20 | 8 | 69 | 0 | 86 | 145 | 86 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 86 and ends at 145. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [86.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls, name=None, inputs=None, par=None, config=None):"""Create a :class:`~ShellBoltSpec` for a Python Bolt.This spec represents this Bolt in a :class:`~streamparse.Topology`.:param name: Name of this Bolt.Defaults to name of :class:`~streamparse.Topology` attribute this is assigned to.:type name:`str`:param inp... | 1 | 11 | 5 | 59 | 0 | 152 | 201 | 152 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 152 and ends at 201. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [152.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls, *args, **kwargs):"""This method exists only to give a more informative error message."""raise TypeError(f"Specifications should either be bolts or spouts. Given: {cls!r}") | 1 | 4 | 3 | 18 | 0 | 20 | 24 | 20 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 20 and ends at 24. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [20.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls,name=None,serialized_java=None,full_class_name=None,args_list=None,par=1,config=None,outputs=None,):"""Create a :class:`JavaSpoutSpec` for a Java Spout.This spec represents this Spout in a :class:`~streamparse.Topology`.You must add the appropriate entries to your classpath by editing yourproject's ``proje... | 1 | 20 | 8 | 69 | 0 | 13 | 65 | 13 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 13 and ends at 65. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 8 parameters, represented as [13.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls, name=None, command=None, script=None, par=None, config=None, outputs=None):"""Create a :class:`ShellSpoutSpec` for a non-Java, non-Python Spout.If you want to create a spec for a Python Spout, use:meth:`~streamparse.dsl.bolt.Spout.spec`.This spec represents this Spout in a :class:`~streamparse.Topology`.:... | 1 | 12 | 7 | 60 | 0 | 70 | 112 | 70 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 70 and ends at 112. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 7 parameters, represented as [70.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | spec | def spec(cls, name=None, par=None, config=None):"""Create a :class:`~ShellBoltSpec` for a Python Spout.This spec represents this Spout in a :class:`~streamparse.Topology`.:param name: Name of this Spout.Defaults to name of :class:`~streamparse.Topology` attribute this is assigned to.:type name:`str`:param par:Paralleli... | 1 | 10 | 4 | 51 | 0 | 119 | 158 | 119 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (spec) defined within the public class called public.The function start at line 119 and ends at 158. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [119.0] and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_basic_spec | def test_basic_spec(self):class WordCount(Topology):word_spout = WordSpout.spec(par=2)word_bolt = WordCountBolt.spec(inputs={word_spout: Grouping.fields("word")}, par=8)self.assertEqual(len(WordCount.specs), 2)self.assertEqual(list(WordCount.word_bolt.inputs.keys()), [WordCount.word_spout["default"]])self.assertEqual(W... | 1 | 18 | 1 | 143 | 0 | 47 | 65 | 47 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_basic_spec) defined within the public class called public.The function start at line 47 and ends at 65. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_spec_with_inputs_as_list | def test_spec_with_inputs_as_list(self):class WordCount(Topology):word_spout = WordSpout.spec(par=2)word_bolt = WordCountBolt.spec(inputs=[word_spout], par=8)self.assertEqual(len(WordCount.specs), 2)self.assertEqual(len(WordCount.thrift_spouts), 1)self.assertEqual(len(WordCount.thrift_bolts), 1)self.assertEqual(list(Wo... | 1 | 14 | 1 | 125 | 0 | 67 | 81 | 67 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_spec_with_inputs_as_list) defined within the public class called public.The function start at line 67 and ends at 81. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_multi_stream_bolt | def test_multi_stream_bolt(self):class WordCount(Topology):word_spout = WordSpout.spec(par=2)word_bolt = MultiStreamWordCountBolt.spec(inputs=[word_spout], par=8)db_dumper_bolt = DatabaseDumperBolt.spec(par=4, inputs=[word_bolt["sum"], word_bolt["default"]])self.assertEqual(len(WordCount.specs), 3)self.assertEqual(len(... | 1 | 25 | 1 | 208 | 0 | 83 | 108 | 83 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_multi_stream_bolt) defined within the public class called public.The function start at line 83 and ends at 108. It contains 25 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_long_chain_spec | def test_long_chain_spec(self):class WordCount(Topology):word_spout = WordSpout.spec()word_bolt1 = WordCountBolt.spec(inputs=[word_spout])word_bolt2 = WordCountBolt.spec(inputs=[word_bolt1])word_bolt3 = WordCountBolt.spec(inputs=[word_bolt2])word_bolt4 = WordCountBolt.spec(inputs=[word_bolt3])word_bolt5 = WordCountBolt... | 2 | 30 | 1 | 320 | 0 | 110 | 140 | 110 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_long_chain_spec) defined within the public class called public.The function start at line 110 and ends at 140. It contains 30 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_many_spouts_spec | def test_many_spouts_spec(self):class WordCount(Topology):word_spout1 = WordSpout.spec()word_spout2 = WordSpout.spec()word_spout3 = WordSpout.spec()word_spout4 = WordSpout.spec()word_spout5 = WordSpout.spec()word_bolt = WordCountBolt.spec(inputs=[word_spout1, word_spout2, word_spout3, word_spout4, word_spout5]) | 1 | 10 | 1 | 66 | 0 | 142 | 151 | 142 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_many_spouts_spec) defined within the public class called public.The function start at line 142 and ends at 151. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_invalid_bolt_group_field | def test_invalid_bolt_group_field(self):# Fields grouping must specify field output by spoutwith self.assertRaises(ValueError):class WordCount(Topology):word_spout = WordSpout.spec()word_bolt = WordCountBolt.spec(inputs={word_spout: Grouping.fields("foo")}) | 1 | 7 | 1 | 45 | 0 | 153 | 161 | 153 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_invalid_bolt_group_field) defined within the public class called public.The function start at line 153 and ends at 161. 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.. |
pystorm_streamparse | public | public | 0 | 0 | test_empty_bolt_group_field | def test_empty_bolt_group_field(self):# Fields groupings require field names to be specifiedwith self.assertRaises(ValueError):class WordCount(Topology):word_spout = WordSpout.spec()word_bolt = WordCountBolt.spec(inputs={word_spout: Grouping.fields()}) | 1 | 5 | 1 | 44 | 0 | 163 | 169 | 163 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_empty_bolt_group_field) defined within the public class called public.The function start at line 163 and ends at 169. 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.. |
pystorm_streamparse | public | public | 0 | 0 | test_duplicate_name | def test_duplicate_name(self):# Each component name must be uniquewith self.assertRaises(ValueError):class WordCount(Topology):word = WordSpout.spec()word_ = WordCountBolt.spec(name="word", inputs=[word]) | 1 | 5 | 1 | 42 | 0 | 171 | 177 | 171 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_duplicate_name) defined within the public class called public.The function start at line 171 and ends at 177. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_no_input_bolt | def test_no_input_bolt(self):# All bolts must have at least one inputwith self.assertRaises(ValueError):class WordCount(Topology):word_spout = WordSpout.spec()word_bolt = WordCountBolt.spec(inputs=[]) | 1 | 5 | 1 | 37 | 0 | 179 | 185 | 179 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_no_input_bolt) defined within the public class called public.The function start at line 179 and ends at 185. 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.. |
pystorm_streamparse | public | public | 0 | 0 | test_no_outputs_spout_empty | def test_no_outputs_spout_empty(self):# All spouts must have output fieldsclass PointlessSpout(Spout):outputs = []with self.assertRaises(ValueError):class WordCount(Topology):word_spout = PointlessSpout.spec() | 1 | 6 | 1 | 36 | 0 | 187 | 195 | 187 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_no_outputs_spout_empty) defined within the public class called public.The function start at line 187 and ends at 195. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_no_outputs_spout | def test_no_outputs_spout(self):# All spouts must have output fieldsclass PointlessSpout(Spout):outputs = []with self.assertRaises(ValueError):class WordCount(Topology):word_spout = PointlessSpout.spec() | 1 | 6 | 1 | 36 | 0 | 197 | 205 | 197 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_no_outputs_spout) defined within the public class called public.The function start at line 197 and ends at 205. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_base_component_rejection | def test_base_component_rejection(self):# Topology components must inherit from Bolt/Spout, not Component directlyclass MyComponent(Component):outputs = []with self.assertRaises(TypeError):class WordCount(Topology):word_spout = MyComponent.spec() | 1 | 6 | 1 | 36 | 0 | 207 | 215 | 207 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_base_component_rejection) defined within the public class called public.The function start at line 207 and ends at 215. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_component_instead_of_spec | def test_component_instead_of_spec(self):# Make sure we catch things early when people forget to call .specwith self.assertRaises(TypeError):class WordCount(Topology):word_spout = WordSpout(input_stream=BytesIO(), output_stream=BytesIO()) | 1 | 4 | 1 | 35 | 0 | 217 | 222 | 217 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_component_instead_of_spec) defined within the public class called public.The function start at line 217 and ends at 222. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_no_spout | def test_no_spout(self):# Every topology must have a spoutwith self.assertRaises(ValueError):class WordCount(Topology):pass | 1 | 4 | 1 | 20 | 0 | 224 | 229 | 224 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_no_spout) defined within the public class called public.The function start at line 224 and ends at 229. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_zero_par | def test_zero_par(self):# Component parallelism (number of processes) can't be 0with self.assertRaises(ValueError):class WordCount(Topology):word_spout = WordSpout.spec(par=0) | 1 | 4 | 1 | 29 | 0 | 231 | 236 | 231 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_zero_par) defined within the public class called public.The function start at line 231 and ends at 236. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_negative_par | def test_negative_par(self):# Component parallelism (number of processes) can't be negativewith self.assertRaises(ValueError):class WordCount(Topology):word_spout = WordSpout.spec(par=-1) | 1 | 4 | 1 | 30 | 0 | 238 | 243 | 238 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_negative_par) defined within the public class called public.The function start at line 238 and ends at 243. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_float_par | def test_float_par(self):# Component parallelism (number of processes) must be an intwith self.assertRaises(TypeError):class WordCount(Topology):word_spout = WordSpout.spec(par=5.4) | 1 | 4 | 1 | 31 | 0 | 245 | 250 | 245 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_float_par) defined within the public class called public.The function start at line 245 and ends at 250. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_dict_par | def test_dict_par(self):# Component parallelism (number of processes) can temporarily be a dictclass WordCount(Topology):word_spout = WordSpout.spec(par={"prod": 5, "beta": 1})self.assertEqual(WordCount.thrift_spouts["word_spout"].common.parallelism_hint,{"prod": 5, "beta": 1},) | 1 | 7 | 1 | 55 | 0 | 252 | 260 | 252 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_dict_par) defined within the public class called public.The function start at line 252 and ends at 260. 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.. |
pystorm_streamparse | public | public | 0 | 0 | test_dict_par_bad_key_type | def test_dict_par_bad_key_type(self):# Component parallelism dict must map for str to intwith self.assertRaises(TypeError):class WordCount(Topology):word_spout = WordSpout.spec(par={1000: 5, "beta": 1}) | 1 | 4 | 1 | 37 | 0 | 262 | 267 | 262 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_dict_par_bad_key_type) defined within the public class called public.The function start at line 262 and ends at 267. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
pystorm_streamparse | public | public | 0 | 0 | test_dict_par_bad_value_type | def test_dict_par_bad_value_type(self):# Component parallelism dict must map for str to intwith self.assertRaises(TypeError):class WordCount(Topology):word_spout = WordSpout.spec(par={"prod": 5.5, "beta": 1}) | 1 | 4 | 1 | 39 | 0 | 269 | 274 | 269 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_dict_par_bad_value_type) defined within the public class called public.The function start at line 269 and ends at 274. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.