How to use d method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

tcm_mod_builder.py

Source:tcm_mod_builder.py Github

copy

Full Screen

...457 line = p.readline()458 # Search for function pointer459 if not re.search('\(\*', line):460 continue461 fabric_ops.append(line.rstrip())462 continue463 line = p.readline()464 # Search for function pointer465 if not re.search('\(\*', line):466 continue467 fabric_ops.append(line.rstrip())468 p.close()469 return470def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):471 buf = ""472 bufi = ""473 f = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.c"474 print "Writing file: " + f475 p = open(f, 'w')476 if not p:477 tcm_mod_err("Unable to open file: " + f)478 fi = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.h"479 print "Writing file: " + fi480 pi = open(fi, 'w')481 if not pi:482 tcm_mod_err("Unable to open file: " + fi)483 buf = "#include <linux/slab.h>\n"484 buf += "#include <linux/kthread.h>\n"485 buf += "#include <linux/types.h>\n"486 buf += "#include <linux/list.h>\n"487 buf += "#include <linux/types.h>\n"488 buf += "#include <linux/string.h>\n"489 buf += "#include <linux/ctype.h>\n"490 buf += "#include <asm/unaligned.h>\n"491 buf += "#include <scsi/scsi.h>\n"492 buf += "#include <scsi/scsi_host.h>\n"493 buf += "#include <scsi/scsi_device.h>\n"494 buf += "#include <scsi/scsi_cmnd.h>\n"495 buf += "#include <scsi/libfc.h>\n\n"496 buf += "#include <target/target_core_base.h>\n"497 buf += "#include <target/target_core_fabric.h>\n"498 buf += "#include <target/target_core_configfs.h>\n\n"499 buf += "#include \"" + fabric_mod_name + "_base.h\"\n"500 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n"501 buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n"502 buf += "{\n"503 buf += " return 1;\n"504 buf += "}\n\n"505 bufi += "int " + fabric_mod_name + "_check_true(struct se_portal_group *);\n"506 buf += "int " + fabric_mod_name + "_check_false(struct se_portal_group *se_tpg)\n"507 buf += "{\n"508 buf += " return 0;\n"509 buf += "}\n\n"510 bufi += "int " + fabric_mod_name + "_check_false(struct se_portal_group *);\n"511 total_fabric_ops = len(fabric_ops)512 i = 0513 while i < total_fabric_ops:514 fo = fabric_ops[i]515 i += 1516# print "fabric_ops: " + fo517 if re.search('get_fabric_name', fo):518 buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n"519 buf += "{\n"520 buf += " return \"" + fabric_mod_name[4:] + "\";\n"521 buf += "}\n\n"522 bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n"523 continue524 if re.search('get_fabric_proto_ident', fo):525 buf += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *se_tpg)\n"526 buf += "{\n"527 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"528 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"529 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"530 buf += " u8 proto_id;\n\n"531 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"532 if proto_ident == "FC":533 buf += " case SCSI_PROTOCOL_FCP:\n"534 buf += " default:\n"535 buf += " proto_id = fc_get_fabric_proto_ident(se_tpg);\n"536 buf += " break;\n"537 elif proto_ident == "SAS":538 buf += " case SCSI_PROTOCOL_SAS:\n"539 buf += " default:\n"540 buf += " proto_id = sas_get_fabric_proto_ident(se_tpg);\n"541 buf += " break;\n"542 elif proto_ident == "iSCSI":543 buf += " case SCSI_PROTOCOL_ISCSI:\n"544 buf += " default:\n"545 buf += " proto_id = iscsi_get_fabric_proto_ident(se_tpg);\n"546 buf += " break;\n"547 buf += " }\n\n"548 buf += " return proto_id;\n"549 buf += "}\n\n"550 bufi += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *);\n"551 if re.search('get_wwn', fo):552 buf += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *se_tpg)\n"553 buf += "{\n"554 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"555 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"556 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n\n"557 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_name[0];\n"558 buf += "}\n\n"559 bufi += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *);\n"560 if re.search('get_tag', fo):561 buf += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *se_tpg)\n"562 buf += "{\n"563 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"564 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"565 buf += " return tpg->" + fabric_mod_port + "_tpgt;\n"566 buf += "}\n\n"567 bufi += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *);\n"568 if re.search('get_default_depth', fo):569 buf += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *se_tpg)\n"570 buf += "{\n"571 buf += " return 1;\n"572 buf += "}\n\n"573 bufi += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *);\n"574 if re.search('get_pr_transport_id\)\(', fo):575 buf += "u32 " + fabric_mod_name + "_get_pr_transport_id(\n"576 buf += " struct se_portal_group *se_tpg,\n"577 buf += " struct se_node_acl *se_nacl,\n"578 buf += " struct t10_pr_registration *pr_reg,\n"579 buf += " int *format_code,\n"580 buf += " unsigned char *buf)\n"581 buf += "{\n"582 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"583 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"584 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"585 buf += " int ret = 0;\n\n"586 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"587 if proto_ident == "FC":588 buf += " case SCSI_PROTOCOL_FCP:\n"589 buf += " default:\n"590 buf += " ret = fc_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n"591 buf += " format_code, buf);\n"592 buf += " break;\n"593 elif proto_ident == "SAS":594 buf += " case SCSI_PROTOCOL_SAS:\n"595 buf += " default:\n"596 buf += " ret = sas_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n"597 buf += " format_code, buf);\n"598 buf += " break;\n"599 elif proto_ident == "iSCSI":600 buf += " case SCSI_PROTOCOL_ISCSI:\n"601 buf += " default:\n"602 buf += " ret = iscsi_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n"603 buf += " format_code, buf);\n"604 buf += " break;\n"605 buf += " }\n\n"606 buf += " return ret;\n"607 buf += "}\n\n"608 bufi += "u32 " + fabric_mod_name + "_get_pr_transport_id(struct se_portal_group *,\n"609 bufi += " struct se_node_acl *, struct t10_pr_registration *,\n"610 bufi += " int *, unsigned char *);\n"611 if re.search('get_pr_transport_id_len\)\(', fo):612 buf += "u32 " + fabric_mod_name + "_get_pr_transport_id_len(\n"613 buf += " struct se_portal_group *se_tpg,\n"614 buf += " struct se_node_acl *se_nacl,\n"615 buf += " struct t10_pr_registration *pr_reg,\n"616 buf += " int *format_code)\n"617 buf += "{\n"618 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"619 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"620 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"621 buf += " int ret = 0;\n\n"622 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"623 if proto_ident == "FC":624 buf += " case SCSI_PROTOCOL_FCP:\n"625 buf += " default:\n"626 buf += " ret = fc_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n"627 buf += " format_code);\n"628 buf += " break;\n"629 elif proto_ident == "SAS":630 buf += " case SCSI_PROTOCOL_SAS:\n"631 buf += " default:\n"632 buf += " ret = sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n"633 buf += " format_code);\n"634 buf += " break;\n"635 elif proto_ident == "iSCSI":636 buf += " case SCSI_PROTOCOL_ISCSI:\n"637 buf += " default:\n"638 buf += " ret = iscsi_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n"639 buf += " format_code);\n"640 buf += " break;\n"641 buf += " }\n\n"642 buf += " return ret;\n"643 buf += "}\n\n"644 bufi += "u32 " + fabric_mod_name + "_get_pr_transport_id_len(struct se_portal_group *,\n"645 bufi += " struct se_node_acl *, struct t10_pr_registration *,\n"646 bufi += " int *);\n"647 if re.search('parse_pr_out_transport_id\)\(', fo):648 buf += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(\n"649 buf += " struct se_portal_group *se_tpg,\n"650 buf += " const char *buf,\n"651 buf += " u32 *out_tid_len,\n"652 buf += " char **port_nexus_ptr)\n"653 buf += "{\n"654 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"655 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n"656 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"657 buf += " char *tid = NULL;\n\n"658 buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"659 if proto_ident == "FC":660 buf += " case SCSI_PROTOCOL_FCP:\n"661 buf += " default:\n"662 buf += " tid = fc_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n"663 buf += " port_nexus_ptr);\n"664 elif proto_ident == "SAS":665 buf += " case SCSI_PROTOCOL_SAS:\n"666 buf += " default:\n"667 buf += " tid = sas_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n"668 buf += " port_nexus_ptr);\n"669 elif proto_ident == "iSCSI":670 buf += " case SCSI_PROTOCOL_ISCSI:\n"671 buf += " default:\n"672 buf += " tid = iscsi_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n"673 buf += " port_nexus_ptr);\n"674 buf += " }\n\n"675 buf += " return tid;\n"676 buf += "}\n\n"677 bufi += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(struct se_portal_group *,\n"678 bufi += " const char *, u32 *, char **);\n"679 if re.search('alloc_fabric_acl\)\(', fo):680 buf += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *se_tpg)\n"681 buf += "{\n"682 buf += " struct " + fabric_mod_name + "_nacl *nacl;\n\n"683 buf += " nacl = kzalloc(sizeof(struct " + fabric_mod_name + "_nacl), GFP_KERNEL);\n"684 buf += " if (!nacl) {\n"685 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_nacl\\n\");\n"686 buf += " return NULL;\n"687 buf += " }\n\n"688 buf += " return &nacl->se_node_acl;\n"689 buf += "}\n\n"690 bufi += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *);\n"691 if re.search('release_fabric_acl\)\(', fo):692 buf += "void " + fabric_mod_name + "_release_fabric_acl(\n"693 buf += " struct se_portal_group *se_tpg,\n"694 buf += " struct se_node_acl *se_nacl)\n"695 buf += "{\n"696 buf += " struct " + fabric_mod_name + "_nacl *nacl = container_of(se_nacl,\n"697 buf += " struct " + fabric_mod_name + "_nacl, se_node_acl);\n"698 buf += " kfree(nacl);\n"699 buf += "}\n\n"700 bufi += "void " + fabric_mod_name + "_release_fabric_acl(struct se_portal_group *,\n"701 bufi += " struct se_node_acl *);\n"702 if re.search('tpg_get_inst_index\)\(', fo):703 buf += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *se_tpg)\n"704 buf += "{\n"705 buf += " return 1;\n"706 buf += "}\n\n"707 bufi += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *);\n"708 if re.search('\*release_cmd\)\(', fo):709 buf += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *se_cmd)\n"710 buf += "{\n"711 buf += " return;\n"712 buf += "}\n\n"713 bufi += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *);\n"714 if re.search('shutdown_session\)\(', fo):715 buf += "int " + fabric_mod_name + "_shutdown_session(struct se_session *se_sess)\n"716 buf += "{\n"717 buf += " return 0;\n"718 buf += "}\n\n"719 bufi += "int " + fabric_mod_name + "_shutdown_session(struct se_session *);\n"720 if re.search('close_session\)\(', fo):721 buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n"722 buf += "{\n"723 buf += " return;\n"724 buf += "}\n\n"725 bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n"726 if re.search('stop_session\)\(', fo):727 buf += "void " + fabric_mod_name + "_stop_session(struct se_session *se_sess, int sess_sleep , int conn_sleep)\n"728 buf += "{\n"729 buf += " return;\n"730 buf += "}\n\n"731 bufi += "void " + fabric_mod_name + "_stop_session(struct se_session *, int, int);\n"732 if re.search('fall_back_to_erl0\)\(', fo):733 buf += "void " + fabric_mod_name + "_reset_nexus(struct se_session *se_sess)\n"734 buf += "{\n"735 buf += " return;\n"736 buf += "}\n\n"737 bufi += "void " + fabric_mod_name + "_reset_nexus(struct se_session *);\n"738 if re.search('sess_logged_in\)\(', fo):739 buf += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *se_sess)\n"740 buf += "{\n"741 buf += " return 0;\n"742 buf += "}\n\n"743 bufi += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *);\n"744 if re.search('sess_get_index\)\(', fo):745 buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n"746 buf += "{\n"747 buf += " return 0;\n"748 buf += "}\n\n"749 bufi += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *);\n"750 if re.search('write_pending\)\(', fo):751 buf += "int " + fabric_mod_name + "_write_pending(struct se_cmd *se_cmd)\n"752 buf += "{\n"753 buf += " return 0;\n"754 buf += "}\n\n"755 bufi += "int " + fabric_mod_name + "_write_pending(struct se_cmd *);\n"756 if re.search('write_pending_status\)\(', fo):757 buf += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *se_cmd)\n"758 buf += "{\n"759 buf += " return 0;\n"760 buf += "}\n\n"761 bufi += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *);\n"762 if re.search('set_default_node_attributes\)\(', fo):763 buf += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *nacl)\n"764 buf += "{\n"765 buf += " return;\n"766 buf += "}\n\n"767 bufi += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *);\n"768 if re.search('get_task_tag\)\(', fo):769 buf += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *se_cmd)\n"770 buf += "{\n"771 buf += " return 0;\n"772 buf += "}\n\n"773 bufi += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *);\n"774 if re.search('get_cmd_state\)\(', fo):775 buf += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *se_cmd)\n"776 buf += "{\n"777 buf += " return 0;\n"778 buf += "}\n\n"779 bufi += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *);\n"780 if re.search('queue_data_in\)\(', fo):781 buf += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *se_cmd)\n"782 buf += "{\n"783 buf += " return 0;\n"784 buf += "}\n\n"785 bufi += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *);\n"786 if re.search('queue_status\)\(', fo):787 buf += "int " + fabric_mod_name + "_queue_status(struct se_cmd *se_cmd)\n"788 buf += "{\n"789 buf += " return 0;\n"790 buf += "}\n\n"791 bufi += "int " + fabric_mod_name + "_queue_status(struct se_cmd *);\n"792 if re.search('queue_tm_rsp\)\(', fo):793 buf += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n"794 buf += "{\n"795 buf += " return 0;\n"796 buf += "}\n\n"797 bufi += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n"798 if re.search('is_state_remove\)\(', fo):799 buf += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *se_cmd)\n"800 buf += "{\n"801 buf += " return 0;\n"802 buf += "}\n\n"803 bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n"804 ret = p.write(buf)805 if ret:806 tcm_mod_err("Unable to write f: " + f)807 p.close()808 ret = pi.write(bufi)809 if ret:810 tcm_mod_err("Unable to write fi: " + fi)811 pi.close()812 return813def tcm_mod_build_kbuild(fabric_mod_dir_var, fabric_mod_name):814 buf = ""815 f = fabric_mod_dir_var + "/Makefile"816 print "Writing file: " + f817 p = open(f, 'w')818 if not p:819 tcm_mod_err("Unable to open file: " + f)820 buf += fabric_mod_name + "-objs := " + fabric_mod_name + "_fabric.o \\\n"821 buf += " " + fabric_mod_name + "_configfs.o\n"822 buf += "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name + ".o\n"823 ret = p.write(buf)824 if ret:825 tcm_mod_err("Unable to write f: " + f)826 p.close()827 return828def tcm_mod_build_kconfig(fabric_mod_dir_var, fabric_mod_name):829 buf = ""830 f = fabric_mod_dir_var + "/Kconfig"831 print "Writing file: " + f832 p = open(f, 'w')833 if not p:834 tcm_mod_err("Unable to open file: " + f)835 buf = "config " + fabric_mod_name.upper() + "\n"836 buf += " tristate \"" + fabric_mod_name.upper() + " fabric module\"\n"837 buf += " depends on TARGET_CORE && CONFIGFS_FS\n"838 buf += " default n\n"839 buf += " ---help---\n"840 buf += " Say Y here to enable the " + fabric_mod_name.upper() + " fabric module\n"841 ret = p.write(buf)842 if ret:843 tcm_mod_err("Unable to write f: " + f)844 p.close()845 return846def tcm_mod_add_kbuild(tcm_dir, fabric_mod_name):847 buf = "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name.lower() + "/\n"848 kbuild = tcm_dir + "/drivers/target/Makefile"849 f = open(kbuild, 'a')850 f.write(buf)851 f.close()852 return853def tcm_mod_add_kconfig(tcm_dir, fabric_mod_name):854 buf = "source \"drivers/target/" + fabric_mod_name.lower() + "/Kconfig\"\n"855 kconfig = tcm_dir + "/drivers/target/Kconfig"856 f = open(kconfig, 'a')857 f.write(buf)858 f.close()859 return860def main(modname, proto_ident):861# proto_ident = "FC"862# proto_ident = "SAS"863# proto_ident = "iSCSI"864 tcm_dir = os.getcwd();865 tcm_dir += "/../../"866 print "tcm_dir: " + tcm_dir867 fabric_mod_name = modname868 fabric_mod_dir = tcm_dir + "drivers/target/" + fabric_mod_name869 print "Set fabric_mod_name: " + fabric_mod_name870 print "Set fabric_mod_dir: " + fabric_mod_dir871 print "Using proto_ident: " + proto_ident872 if proto_ident != "FC" and proto_ident != "SAS" and proto_ident != "iSCSI":873 print "Unsupported proto_ident: " + proto_ident874 sys.exit(1)875 ret = tcm_mod_create_module_subdir(fabric_mod_dir)876 if ret:877 print "tcm_mod_create_module_subdir() failed because module already exists!"878 sys.exit(1)879 tcm_mod_build_base_includes(proto_ident, fabric_mod_dir, fabric_mod_name)880 tcm_mod_scan_fabric_ops(tcm_dir)881 tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir, fabric_mod_name)882 tcm_mod_build_configfs(proto_ident, fabric_mod_dir, fabric_mod_name)883 tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name)884 tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name)885 input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Makefile..? [yes,no]: ")886 if input == "yes" or input == "y":887 tcm_mod_add_kbuild(tcm_dir, fabric_mod_name)888 input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Kconfig..? [yes,no]: ")889 if input == "yes" or input == "y":890 tcm_mod_add_kconfig(tcm_dir, fabric_mod_name)891 return892parser = optparse.OptionParser()893parser.add_option('-m', '--modulename', help='Module name', dest='modname',894 action='store', nargs=1, type='string')895parser.add_option('-p', '--protoident', help='Protocol Ident', dest='protoident',896 action='store', nargs=1, type='string')897(opts, args) = parser.parse_args()898mandatories = ['modname', 'protoident']899for m in mandatories:900 if not opts.__dict__[m]:901 print "mandatory option is missing\n"...

Full Screen

Full Screen

sched-migration.py

Source:sched-migration.py Github

copy

Full Screen

...12import os13import sys14from collections import defaultdict15from UserList import UserList16sys.path.append(os.environ['PERF_EXEC_PATH'] + \17 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')18sys.path.append('scripts/python/Perf-Trace-Util/lib/Perf/Trace')19from perf_trace_context import *20from Core import *21from SchedGui import *22threads = { 0 : "idle"}23def thread_name(pid):24 return "%s:%d" % (threads[pid], pid)25class RunqueueEventUnknown:26 @staticmethod27 def color():28 return None29 def __repr__(self):30 return "unknown"31class RunqueueEventSleep:32 @staticmethod33 def color():34 return (0, 0, 0xff)35 def __init__(self, sleeper):36 self.sleeper = sleeper37 def __repr__(self):38 return "%s gone to sleep" % thread_name(self.sleeper)39class RunqueueEventWakeup:40 @staticmethod41 def color():42 return (0xff, 0xff, 0)43 def __init__(self, wakee):44 self.wakee = wakee45 def __repr__(self):46 return "%s woke up" % thread_name(self.wakee)47class RunqueueEventFork:48 @staticmethod49 def color():50 return (0, 0xff, 0)51 def __init__(self, child):52 self.child = child53 def __repr__(self):54 return "new forked task %s" % thread_name(self.child)55class RunqueueMigrateIn:56 @staticmethod57 def color():58 return (0, 0xf0, 0xff)59 def __init__(self, new):60 self.new = new61 def __repr__(self):62 return "task migrated in %s" % thread_name(self.new)63class RunqueueMigrateOut:64 @staticmethod65 def color():66 return (0xff, 0, 0xff)67 def __init__(self, old):68 self.old = old69 def __repr__(self):70 return "task migrated out %s" % thread_name(self.old)71class RunqueueSnapshot:72 def __init__(self, tasks = [0], event = RunqueueEventUnknown()):73 self.tasks = tuple(tasks)74 self.event = event75 def sched_switch(self, prev, prev_state, next):76 event = RunqueueEventUnknown()77 if taskState(prev_state) == "R" and next in self.tasks \78 and prev in self.tasks:79 return self80 if taskState(prev_state) != "R":81 event = RunqueueEventSleep(prev)82 next_tasks = list(self.tasks[:])83 if prev in self.tasks:84 if taskState(prev_state) != "R":85 next_tasks.remove(prev)86 elif taskState(prev_state) == "R":87 next_tasks.append(prev)88 if next not in next_tasks:89 next_tasks.append(next)90 return RunqueueSnapshot(next_tasks, event)91 def migrate_out(self, old):92 if old not in self.tasks:93 return self94 next_tasks = [task for task in self.tasks if task != old]95 return RunqueueSnapshot(next_tasks, RunqueueMigrateOut(old))96 def __migrate_in(self, new, event):97 if new in self.tasks:98 self.event = event99 return self100 next_tasks = self.tasks[:] + tuple([new])101 return RunqueueSnapshot(next_tasks, event)102 def migrate_in(self, new):103 return self.__migrate_in(new, RunqueueMigrateIn(new))104 def wake_up(self, new):105 return self.__migrate_in(new, RunqueueEventWakeup(new))106 def wake_up_new(self, new):107 return self.__migrate_in(new, RunqueueEventFork(new))108 def load(self):109 """ Provide the number of tasks on the runqueue.110 Don't count idle"""111 return len(self.tasks) - 1112 def __repr__(self):113 ret = self.tasks.__repr__()114 ret += self.origin_tostring()115 return ret116class TimeSlice:117 def __init__(self, start, prev):118 self.start = start119 self.prev = prev120 self.end = start121 # cpus that triggered the event122 self.event_cpus = []123 if prev is not None:124 self.total_load = prev.total_load125 self.rqs = prev.rqs.copy()126 else:127 self.rqs = defaultdict(RunqueueSnapshot)128 self.total_load = 0129 def __update_total_load(self, old_rq, new_rq):130 diff = new_rq.load() - old_rq.load()131 self.total_load += diff132 def sched_switch(self, ts_list, prev, prev_state, next, cpu):133 old_rq = self.prev.rqs[cpu]134 new_rq = old_rq.sched_switch(prev, prev_state, next)135 if old_rq is new_rq:136 return137 self.rqs[cpu] = new_rq138 self.__update_total_load(old_rq, new_rq)139 ts_list.append(self)140 self.event_cpus = [cpu]141 def migrate(self, ts_list, new, old_cpu, new_cpu):142 if old_cpu == new_cpu:143 return144 old_rq = self.prev.rqs[old_cpu]145 out_rq = old_rq.migrate_out(new)146 self.rqs[old_cpu] = out_rq147 self.__update_total_load(old_rq, out_rq)148 new_rq = self.prev.rqs[new_cpu]149 in_rq = new_rq.migrate_in(new)150 self.rqs[new_cpu] = in_rq151 self.__update_total_load(new_rq, in_rq)152 ts_list.append(self)153 if old_rq is not out_rq:154 self.event_cpus.append(old_cpu)155 self.event_cpus.append(new_cpu)156 def wake_up(self, ts_list, pid, cpu, fork):157 old_rq = self.prev.rqs[cpu]158 if fork:159 new_rq = old_rq.wake_up_new(pid)160 else:161 new_rq = old_rq.wake_up(pid)162 if new_rq is old_rq:163 return164 self.rqs[cpu] = new_rq165 self.__update_total_load(old_rq, new_rq)166 ts_list.append(self)167 self.event_cpus = [cpu]168 def next(self, t):169 self.end = t170 return TimeSlice(t, self)171class TimeSliceList(UserList):172 def __init__(self, arg = []):173 self.data = arg174 def get_time_slice(self, ts):175 if len(self.data) == 0:176 slice = TimeSlice(ts, TimeSlice(-1, None))177 else:178 slice = self.data[-1].next(ts)179 return slice180 def find_time_slice(self, ts):181 start = 0182 end = len(self.data)183 found = -1184 searching = True185 while searching:186 if start == end or start == end - 1:187 searching = False188 i = (end + start) / 2189 if self.data[i].start <= ts and self.data[i].end >= ts:190 found = i191 end = i192 continue193 if self.data[i].end < ts:194 start = i195 elif self.data[i].start > ts:196 end = i197 return found198 def set_root_win(self, win):199 self.root_win = win200 def mouse_down(self, cpu, t):201 idx = self.find_time_slice(t)202 if idx == -1:203 return204 ts = self[idx]205 rq = ts.rqs[cpu]206 raw = "CPU: %d\n" % cpu207 raw += "Last event : %s\n" % rq.event.__repr__()208 raw += "Timestamp : %d.%06d\n" % (ts.start / (10 ** 9), (ts.start % (10 ** 9)) / 1000)209 raw += "Duration : %6d us\n" % ((ts.end - ts.start) / (10 ** 6))210 raw += "Load = %d\n" % rq.load()211 for t in rq.tasks:212 raw += "%s \n" % thread_name(t)213 self.root_win.update_summary(raw)214 def update_rectangle_cpu(self, slice, cpu):215 rq = slice.rqs[cpu]216 if slice.total_load != 0:217 load_rate = rq.load() / float(slice.total_load)218 else:219 load_rate = 0220 red_power = int(0xff - (0xff * load_rate))221 color = (0xff, red_power, red_power)222 top_color = None223 if cpu in slice.event_cpus:224 top_color = rq.event.color()225 self.root_win.paint_rectangle_zone(cpu, color, top_color, slice.start, slice.end)226 def fill_zone(self, start, end):227 i = self.find_time_slice(start)228 if i == -1:229 return230 for i in xrange(i, len(self.data)):231 timeslice = self.data[i]232 if timeslice.start > end:233 return234 for cpu in timeslice.rqs:235 self.update_rectangle_cpu(timeslice, cpu)236 def interval(self):237 if len(self.data) == 0:238 return (0, 0)239 return (self.data[0].start, self.data[-1].end)240 def nr_rectangles(self):241 last_ts = self.data[-1]242 max_cpu = 0243 for cpu in last_ts.rqs:244 if cpu > max_cpu:245 max_cpu = cpu246 return max_cpu247class SchedEventProxy:248 def __init__(self):249 self.current_tsk = defaultdict(lambda : -1)250 self.timeslices = TimeSliceList()251 def sched_switch(self, headers, prev_comm, prev_pid, prev_prio, prev_state,252 next_comm, next_pid, next_prio):253 """ Ensure the task we sched out this cpu is really the one254 we logged. Otherwise we may have missed traces """255 on_cpu_task = self.current_tsk[headers.cpu]256 if on_cpu_task != -1 and on_cpu_task != prev_pid:257 print "Sched switch event rejected ts: %s cpu: %d prev: %s(%d) next: %s(%d)" % \258 (headers.ts_format(), headers.cpu, prev_comm, prev_pid, next_comm, next_pid)259 threads[prev_pid] = prev_comm260 threads[next_pid] = next_comm261 self.current_tsk[headers.cpu] = next_pid262 ts = self.timeslices.get_time_slice(headers.ts())263 ts.sched_switch(self.timeslices, prev_pid, prev_state, next_pid, headers.cpu)264 def migrate(self, headers, pid, prio, orig_cpu, dest_cpu):265 ts = self.timeslices.get_time_slice(headers.ts())266 ts.migrate(self.timeslices, pid, orig_cpu, dest_cpu)267 def wake_up(self, headers, comm, pid, success, target_cpu, fork):268 if success == 0:269 return270 ts = self.timeslices.get_time_slice(headers.ts())271 ts.wake_up(self.timeslices, pid, target_cpu, fork)272def trace_begin():273 global parser274 parser = SchedEventProxy()275def trace_end():276 app = wx.App(False)277 timeslices = parser.timeslices278 frame = RootFrame(timeslices, "Migration")279 app.MainLoop()280def sched__sched_stat_runtime(event_name, context, common_cpu,281 common_secs, common_nsecs, common_pid, common_comm,282 common_callchain, comm, pid, runtime, vruntime):283 pass284def sched__sched_stat_iowait(event_name, context, common_cpu,285 common_secs, common_nsecs, common_pid, common_comm,286 common_callchain, comm, pid, delay):287 pass288def sched__sched_stat_sleep(event_name, context, common_cpu,289 common_secs, common_nsecs, common_pid, common_comm,290 common_callchain, comm, pid, delay):291 pass292def sched__sched_stat_wait(event_name, context, common_cpu,293 common_secs, common_nsecs, common_pid, common_comm,294 common_callchain, comm, pid, delay):295 pass296def sched__sched_process_fork(event_name, context, common_cpu,297 common_secs, common_nsecs, common_pid, common_comm,298 common_callchain, parent_comm, parent_pid, child_comm, child_pid):299 pass300def sched__sched_process_wait(event_name, context, common_cpu,301 common_secs, common_nsecs, common_pid, common_comm,302 common_callchain, comm, pid, prio):303 pass304def sched__sched_process_exit(event_name, context, common_cpu,305 common_secs, common_nsecs, common_pid, common_comm,306 common_callchain, comm, pid, prio):307 pass308def sched__sched_process_free(event_name, context, common_cpu,309 common_secs, common_nsecs, common_pid, common_comm,310 common_callchain, comm, pid, prio):311 pass312def sched__sched_migrate_task(event_name, context, common_cpu,313 common_secs, common_nsecs, common_pid, common_comm,314 common_callchain, comm, pid, prio, orig_cpu,315 dest_cpu):316 headers = EventHeaders(common_cpu, common_secs, common_nsecs,317 common_pid, common_comm, common_callchain)318 parser.migrate(headers, pid, prio, orig_cpu, dest_cpu)319def sched__sched_switch(event_name, context, common_cpu,320 common_secs, common_nsecs, common_pid, common_comm, common_callchain,321 prev_comm, prev_pid, prev_prio, prev_state,322 next_comm, next_pid, next_prio):323 headers = EventHeaders(common_cpu, common_secs, common_nsecs,324 common_pid, common_comm, common_callchain)325 parser.sched_switch(headers, prev_comm, prev_pid, prev_prio, prev_state,326 next_comm, next_pid, next_prio)327def sched__sched_wakeup_new(event_name, context, common_cpu,328 common_secs, common_nsecs, common_pid, common_comm,329 common_callchain, comm, pid, prio, success,330 target_cpu):331 headers = EventHeaders(common_cpu, common_secs, common_nsecs,332 common_pid, common_comm, common_callchain)333 parser.wake_up(headers, comm, pid, success, target_cpu, 1)334def sched__sched_wakeup(event_name, context, common_cpu,335 common_secs, common_nsecs, common_pid, common_comm,336 common_callchain, comm, pid, prio, success,337 target_cpu):338 headers = EventHeaders(common_cpu, common_secs, common_nsecs,339 common_pid, common_comm, common_callchain)340 parser.wake_up(headers, comm, pid, success, target_cpu, 0)341def sched__sched_wait_task(event_name, context, common_cpu,342 common_secs, common_nsecs, common_pid, common_comm,343 common_callchain, comm, pid, prio):344 pass345def sched__sched_kthread_stop_ret(event_name, context, common_cpu,346 common_secs, common_nsecs, common_pid, common_comm,347 common_callchain, ret):348 pass349def sched__sched_kthread_stop(event_name, context, common_cpu,350 common_secs, common_nsecs, common_pid, common_comm,351 common_callchain, comm, pid):352 pass353def trace_unhandled(event_name, context, event_fields_dict):...

Full Screen

Full Screen

tg_train_GNNclf.py

Source:tg_train_GNNclf.py Github

copy

Full Screen

...92 for batch_idx, data in enumerate(train_loader):93 # data = train_set[0]94 if CUDA:95 data = data.cuda()96 optimizer.zero_grad()97 prediction_y = clf_model(data.x,data.edge_index)98 loss = loss_function(prediction_y,data.y.unsqueeze(1))99 loss.backward()100 optimizer.step()101 avg_loss += loss.item()102 prediction_y_acc = prediction_y>probability_threshold103 avg_accuracy += (prediction_y_acc == data.y.unsqueeze(1)).sum().item()104 if batch_idx % 1000 == 0:105 print(prediction_y.view(-1))106 print(data.y.view(-1))107 print(f'each batch: {loss.item()}',end='\r')108 avg_loss /= n_train_loader109 avg_accuracy /= (n_train_set*n_obstacles)110 print(f'epoch loss: {avg_loss}')111 print(f'epoch accuracy: {avg_accuracy*100}%')112 writer.add_scalar("tg_epoch_loss", avg_loss, epoch)113 writer.add_scalar("tg_epoch_accuracy", avg_accuracy, epoch)114 for tag, value in clf_model.named_parameters():115 if value.grad is not None:116 writer.add_histogram(tag + "/grad", value.grad.cpu(), epoch)117 118 # test part119 test_avg_loss = 0120 test_avg_accuracy = 0121 with torch.no_grad():122 for batch_idx, data in enumerate(test_loader):123 if CUDA:124 data = data.cuda()125 prediction_y = clf_model(data.x,data.edge_index)126 loss = loss_function(prediction_y,data.y.unsqueeze(1))127 test_avg_loss += loss.item()128 prediction_y_acc = prediction_y>probability_threshold129 test_avg_accuracy += (prediction_y_acc == data.y.unsqueeze(1)).sum().item()130 print(f'test each batch: {loss.item()}',end='\r')131 test_avg_loss /= n_test_loader132 test_avg_accuracy /= (n_test_set*n_obstacles)133 print(f'test epoch loss: {test_avg_loss}')134 print(f'test epoch accuracy: {test_avg_accuracy*100}%')135 writer.add_scalar("test_epoch_loss", test_avg_loss, epoch)...

Full Screen

Full Screen

SchedGui.py

Source:SchedGui.py Github

copy

Full Screen

...36 self.scroll.EnableScrolling(True, True)37 self.scroll.SetFocus()38 # scrollable drawing area39 self.scroll_panel = wx.Panel(self.scroll, size=(self.screen_width - 15, self.screen_height / 2))40 self.scroll_panel.Bind(wx.EVT_PAINT, self.on_paint)41 self.scroll_panel.Bind(wx.EVT_KEY_DOWN, self.on_key_press)42 self.scroll_panel.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_down)43 self.scroll.Bind(wx.EVT_PAINT, self.on_paint)44 self.scroll.Bind(wx.EVT_KEY_DOWN, self.on_key_press)45 self.scroll.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_down)46 self.scroll.Fit()47 self.Fit()48 self.scroll_panel.SetDimensions(-1, -1, self.width_virtual, self.height_virtual, wx.SIZE_USE_EXISTING)49 self.txt = None50 self.Show(True)51 def us_to_px(self, val):52 return val / (10 ** 3) * self.zoom53 def px_to_us(self, val):54 return (val / self.zoom) * (10 ** 3)55 def scroll_start(self):56 (x, y) = self.scroll.GetViewStart()57 return (x * self.scroll_scale, y * self.scroll_scale)58 def scroll_start_us(self):59 (x, y) = self.scroll_start()60 return self.px_to_us(x)61 def paint_rectangle_zone(self, nr, color, top_color, start, end):62 offset_px = self.us_to_px(start - self.ts_start)63 width_px = self.us_to_px(end - self.ts_start)64 offset_py = RootFrame.Y_OFFSET + (nr * (RootFrame.RECT_HEIGHT + RootFrame.RECT_SPACE))65 width_py = RootFrame.RECT_HEIGHT66 dc = self.dc67 if top_color is not None:68 (r, g, b) = top_color69 top_color = wx.Colour(r, g, b)70 brush = wx.Brush(top_color, wx.SOLID)71 dc.SetBrush(brush)72 dc.DrawRectangle(offset_px, offset_py, width_px, RootFrame.EVENT_MARKING_WIDTH)73 width_py -= RootFrame.EVENT_MARKING_WIDTH74 offset_py += RootFrame.EVENT_MARKING_WIDTH75 (r ,g, b) = color76 color = wx.Colour(r, g, b)77 brush = wx.Brush(color, wx.SOLID)78 dc.SetBrush(brush)79 dc.DrawRectangle(offset_px, offset_py, width_px, width_py)80 def update_rectangles(self, dc, start, end):81 start += self.ts_start82 end += self.ts_start83 self.sched_tracer.fill_zone(start, end)84 def on_paint(self, event):85 dc = wx.PaintDC(self.scroll_panel)86 self.dc = dc87 width = min(self.width_virtual, self.screen_width)88 (x, y) = self.scroll_start()89 start = self.px_to_us(x)90 end = self.px_to_us(x + width)91 self.update_rectangles(dc, start, end)92 def rect_from_ypixel(self, y):93 y -= RootFrame.Y_OFFSET94 rect = y / (RootFrame.RECT_HEIGHT + RootFrame.RECT_SPACE)95 height = y % (RootFrame.RECT_HEIGHT + RootFrame.RECT_SPACE)96 if rect < 0 or rect > self.nr_rects - 1 or height > RootFrame.RECT_HEIGHT:97 return -198 return rect99 def update_summary(self, txt):100 if self.txt:101 self.txt.Destroy()102 self.txt = wx.StaticText(self.panel, -1, txt, (0, (self.screen_height / 2) + 50))103 def on_mouse_down(self, event):104 (x, y) = event.GetPositionTuple()105 rect = self.rect_from_ypixel(y)106 if rect == -1:107 return108 t = self.px_to_us(x) + self.ts_start109 self.sched_tracer.mouse_down(rect, t)110 def update_width_virtual(self):111 self.width_virtual = self.us_to_px(self.ts_end - self.ts_start)112 def __zoom(self, x):113 self.update_width_virtual()114 (xpos, ypos) = self.scroll.GetViewStart()115 xpos = self.us_to_px(x) / self.scroll_scale116 self.scroll.SetScrollbars(self.scroll_scale, self.scroll_scale, self.width_virtual / self.scroll_scale, self.height_virtual / self.scroll_scale, xpos, ypos)117 self.Refresh()118 def zoom_in(self):119 x = self.scroll_start_us()120 self.zoom *= 2121 self.__zoom(x)122 def zoom_out(self):123 x = self.scroll_start_us()124 self.zoom /= 2125 self.__zoom(x)126 def on_key_press(self, event):127 key = event.GetRawKeyCode()128 if key == ord("+"):129 self.zoom_in()130 return131 if key == ord("-"):132 self.zoom_out()133 return134 key = event.GetKeyCode()135 (x, y) = self.scroll.GetViewStart()136 if key == wx.WXK_RIGHT:137 self.scroll.Scroll(x + 1, y)138 elif key == wx.WXK_LEFT:139 self.scroll.Scroll(x - 1, y)140 elif key == wx.WXK_DOWN:141 self.scroll.Scroll(x, y + 1)142 elif key == wx.WXK_UP:...

Full Screen

Full Screen

unwcheck.py

Source:unwcheck.py Github

copy

Full Screen

1#!/usr/bin/python2#3# Usage: unwcheck.py FILE4#5# This script checks the unwind info of each function in file FILE6# and verifies that the sum of the region-lengths matches the total7# length of the function.8#9# Based on a shell/awk script originally written by Harish Patil,10# which was converted to Perl by Matthew Chapman, which was converted11# to Python by David Mosberger.12#13import os14import re15import sys16if len(sys.argv) != 2:17 print "Usage: %s FILE" % sys.argv[0]18 sys.exit(2)19readelf = os.getenv("READELF", "readelf")20start_pattern = re.compile("<([^>]*)>: \[0x([0-9a-f]+)-0x([0-9a-f]+)\]")21rlen_pattern = re.compile(".*rlen=([0-9]+)")22def check_func (func, slots, rlen_sum):23 if slots != rlen_sum:24 global num_errors25 num_errors += 126 if not func: func = "[%#x-%#x]" % (start, end)27 print "ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum)28 return29num_funcs = 030num_errors = 031func = False32slots = 033rlen_sum = 034for line in os.popen("%s -u %s" % (readelf, sys.argv[1])):35 m = start_pattern.match(line)36 if m:37 check_func(func, slots, rlen_sum)38 func = m.group(1)39 start = long(m.group(2), 16)40 end = long(m.group(3), 16)41 slots = 3 * (end - start) / 1642 rlen_sum = 0L43 num_funcs += 144 else:45 m = rlen_pattern.match(line)46 if m:47 rlen_sum += long(m.group(1))48check_func(func, slots, rlen_sum)49if num_errors == 0:50 print "No errors detected in %u functions." % num_funcs51else:52 if num_errors > 1:53 err="errors"54 else:55 err="error"56 print "%u %s detected in %u functions." % (num_errors, err, num_funcs)...

Full Screen

Full Screen

syscall-counts.py

Source:syscall-counts.py Github

copy

Full Screen

...5# Displays system-wide system call totals, broken down by syscall.6# If a [comm] arg is specified, only syscalls called by [comm] are displayed.7import os8import sys9sys.path.append(os.environ['PERF_EXEC_PATH'] + \10 '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')11from perf_trace_context import *12from Core import *13from Util import syscall_name14usage = "perf script -s syscall-counts.py [comm]\n";15for_comm = None16if len(sys.argv) > 2:17 sys.exit(usage)18if len(sys.argv) > 1:19 for_comm = sys.argv[1]20syscalls = autodict()21def trace_begin():22 print "Press control+C to stop and show the summary"23def trace_end():24 print_syscall_totals()25def raw_syscalls__sys_enter(event_name, context, common_cpu,26 common_secs, common_nsecs, common_pid, common_comm,27 common_callchain, id, args):28 if for_comm is not None:29 if common_comm != for_comm:30 return31 try:32 syscalls[id] += 133 except TypeError:34 syscalls[id] = 135def syscalls__sys_enter(event_name, context, common_cpu,36 common_secs, common_nsecs, common_pid, common_comm,37 id, args):38 raw_syscalls__sys_enter(**locals())39def print_syscall_totals():40 if for_comm is not None:41 print "\nsyscall events for %s:\n\n" % (for_comm),42 else:43 print "\nsyscall events:\n\n",44 print "%-40s %10s\n" % ("event", "count"),45 print "%-40s %10s\n" % ("----------------------------------------", \46 "-----------"),47 for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \48 reverse = True):...

Full Screen

Full Screen

tg_DataClass.py

Source:tg_DataClass.py Github

copy

Full Screen

1class MCRdata:2 def __init__(self):3 self.graph = list()4 self.ob_label = list()5 self.traj = list()6 self.aabb = list()7 self.circle = list()8 self.radius = list()9 self.planning_time = list()10 self.sectors = list()11class GraphSaveClass:12 def __init__(self,x=list(),edge=list(),y=list(),key_configuration_size=0):13 self.x = x14 self.edge = edge15 self.y = y...

Full Screen

Full Screen

myModel_config.py

Source:myModel_config.py Github

copy

Full Screen

1from typing import Dict2# AE model parameters3AE_config : Dict = dict()...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1{2 "dependencies": {3 },4 "browser": {5 }6}7{8 "dependencies": {9 },10 "browserify": {11 }12}

Full Screen

Using AI Code Generation

copy

Full Screen

1const { d } = require('fast-check-monorepo');2const { d } = require('fast-check-monorepo');3const { d } = require('fast-check-monorepo');4const { d } = require('fast-check-monorepo');5const { d } = require('fast-check-monorepo');6const { d } = require('fast-check-monorepo');7const { d } = require('fast-check-monorepo');8const { d } = require('fast-check-monorepo');9const { d } = require('fast-check-monorepo');10const { d } = require('fast-check-monorepo');11const { d } = require('fast-check-monorepo');12const { d } = require('fast-check-monorepo');13const { d } = require('fast-check-monorepo');14const { d } = require('fast-check-monorepo');15const { d } = require('fast-check-monorepo');16const { d } = require('fast-check-monorepo');17const { d } = require('fast-check-monorepo');18const { d } = require('fast

Full Screen

Using AI Code Generation

copy

Full Screen

1const d = require('fast-check-monorepo/d');2const d = require('fast-check-monorepo/d');3const d = require('fast-check-monorepo/d', { resolve: require.resolve.bind(require) });4const d = require('fast-check-monorepo/d', { resolve: require.resolve.bind(require) });5const d = require('fast-check-monorepo/d', { resolve: { request: 'fast-check-monorepo/d' } });6const d = require('fast-check-monorepo/d', { resolve: { request: 'fast-check-monorepo/d' } });

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fast-check-monorepo automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful