@emwdx/

GroupGenerator

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6066033447802675","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJhbmRvbQoKI1RoZXNlIGFyZSB0aGUgbGlzdHMgb2YgbXkgc3R1ZGVudHMnIG5hbWVzIGZvciBlYWNoIGNsYXNzLgpyb2JvdGljc19zdHVkZW50cyA9IFsndGhvbWFzJywnY2hlcnJ5JywnanVuYm8nLCdkYXBoaW5lJywnbWluLXhpdScsJ2tldmluJywnZWxlbmEnXQptYXRoOSA9IFsnYmVubnknLCdtaW4nLCdqYWNrJywnc29waGlhJywnZGl5YScsJ2NhbmRpY2UnLCdtYW5hcicsJ2plbmlmZXInLCd5dS1reXVuZycsJ2NocmlzdGlhbicsJ3BpZXRybycsJ2FuZHJldycsJ2p1bi15dSddCmFhX3N0dWRlbnRzID0gWyd5dS1jaHVuZycsJ21heCcsJ2tldmluJywna2FyZW4nLCdsdWNpbmRhJywneGVuaWEnLCdhcG9sbGluZScsJ2plc3NlJ10KI2Fkdmlzb3J5ID0gWydmbG8nLCAnc2FtJywgJ2plc3NpZScsICdtYWl0aScsICAnbWluLXhpdScsICdwYXVsJywgJ3Rob21hcycsJ25vYWgnLCd5dW4temhpJ10KaWJtYXRoMj0gWyd2YW5lc3NhJywnYWxleCcsJ3NoYW5lJywnanVuLWhhbycsJ3JvZGljaycsJ2VsZW5hJywnc3VraScsJ2RhcGhpbmUnXQpwaHlzaWNzID0gWydtaW4teGl1JywnamVzc2llJywndGhvbWFzJywneXVuLXpoaSddCmlibWF0aDEgPSBbJ2VtbWEnLCdrYXJlbicsJ3hlbmlhJywna2V2aW4nLCdsdWNpbmRhJywnY2FybWVuJywnbmlydmFhbicsJ3NhYXJ0aGFrJ10KZ2VvMiA9IFsnc3RldmUnLCdjYXJtZW4nLCdsaWFubmUnLCdqYXNvbicsJ3l1LWNodW5nJywna2ltJyw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CdjYXJyaWUnLCdjYWRlbicsJ2FuIHRoaScsJ2ppeW91biddCmFkdmlzb3J5ID0gWydhbmdlbCcsJ3RvbW15JywnbWFpJywnaml5b29uJywnYWxpbmEnLCdydWJ5JywnbWFyaWVsbGUnLCdqZW9uZ3dvbycsJ2ppaHdhbicsJ2ZyYW5uaWUnLCdhbmdpZSddCgojU2Nyb2xsIGRvd24gdG8gdGhlIGxpbmUgbWFya2VkIEVOVEVSIElORk9STUFUSU9OIEhFUkUgLSB0aGlzIGlzIGFsbCB0aGUgZm9ybXVsYXRpb24gb2YgbXkgZ3JvdXBpbmcgYWxnb3JpdGhtLgoKZGVmIGdldF9ncm91cHMobmFtZXMscGFyYW1ldGVycyk6CiAgICAgICAgdG90YWwgPSAwCiAgICAgICAgaSA9IDAKICAgICAgICBvdXRwdXQgPSBbXQogICAgICAgIGZvciBpdGVtIGluIHBhcmFtZXRlcnM6CiAgICAgICAgICAgICAgICBpID0gaSArIDEKICAgICAgICAgICAgICAgIHRvdGFsID0gdG90YWwgKyBpKnBhcmFtZXRlcnNbaS0xXQogICAgICAgIGlmICh0b3RhbCE9bGVuKG5hbWVzKSk6CiAgICAgICAgICAgICAgICBwcmludCAoJ1BhcmFtZXRlcnMgbm90IHNldCBjb3JyZWN0bHknKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICByYW5kb20uc2h1ZmZsZShuYW1lcykKICAgICAgICAgICAgICAgIHJhbmRvbS5zaHVmZmxlKG5hbWVzKQogICAgICAgICAgICAgICAgcmFuZG9tLnNodWZmbGUobmFtZXMpCiAgICAgICAgICAgICAgICByYW5kb20uc2h1ZmZsZShuYW1lcykKICAgICAgICAgICAgICAgIHJhbmRvbS5zaHVmZmxlKG5hbWVzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpID0gMAogICAgICAgICAgICAgICAgY3Vycl9pbmRleCA9IDAKICAgICAgICAgICAgICAgIG51bSA9IDEKICAgICAgICAgICAgICAgIGZvciBpdGVtIGluIHBhcmFtZXRlcnM6CgoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0hPTApOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDAsaXRlbSk6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX2dyb3VwID0gbmFtZXNbMDpudW1dCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQuYXBwZW5kKHRlbXBfZ3JvdXApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWwgbmFtZXNbMDpudW1dCiAgICAgICAgICAgICAgICAgICAgICAgIG51bSArPTEKICAgICAgICBncm91cEluZGV4ID0gMSAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgIGZvciBncm91cCBpbiBvdXRwdXQ6CiAgICAgICAgICAgICAgICBwcmludCgiR3JvdXAgIitzdHIoZ3JvdXBJbmRleCkrIjoiKQogICAgICAgICAgICAgICAgZ3JvdXBTdHJpbmc9IiIKICAgICAgICAgICAgICAgIGZvciBuYW1lIGluIGdyb3VwOgogICAgICAgICAgICAgICAgICAgICAgICBncm91cFN0cmluZys9KG5hbWUrIiwiKQogICAgICAgICAgICAgICAgcHJpbnQgKGdyb3VwU3RyaW5nKQogICAgICAgICAgICAgICAgZ3JvdXBJbmRleCs9MQogICAgICAgICAgICAgICAgICAgICAgICAKI0VOVEVSIElORk9STUFUSU9OIEhFUkUKZ2V0X2dyb3VwcyhwcmVjYWxjRSxbMCwwLDIsNF0pCiNnZXRfZ3JvdXBzKGFsZzIsWzAsMCw0XSkKI2dldF9ncm91cHMoaWJtYXRoRixbMCwwLDIsMl0pCiNnZXRfZ3JvdXBzKGlibWF0aEIsWzAsMCw0LDJdKQojZ2V0X2dyb3VwcyhwcmVjYWxjQyxbMCwwLDMsMV0pIAojZ2V0X2dyb3VwcyhtYXRoOSxbMCwwLDIsMl0pCiNnZXRfZ3JvdXBzKG1hdGg5LFswLDAsMywxXSkgCiNnZXRfZ3JvdXBzKHNpeHRoYm95cyxbMCwxLDNdKQojZ2V0X2dyb3VwcyhzaXh0aGdpcmxzLFswLDEsNF0pCiNnZXRfZ3JvdXBzKGlibWF0aDEsWzAsMCwwLDJdKQojZ2V0X2dyb3VwcyhhYV9zdHVkZW50cyxbOF0pCiNnZXRfZ3JvdXBzKHBoeXNpY3MsWzRdKQojZ2V0X2dyb3VwcyhhZHZpc29yeSxbMCwxLDNdKQojZ2V0X2dyb3VwcyhjYWxjdWx1cyxbMTEsMCwwXSkKI2dldF9ncm91cHMobXNyb2JvdHMsWzAsMCwyLDJdKSAgICAgICAgICAgICAgICAKI2dldF9ncm91cHMocm9ib3RpY3Nfc3R1ZGVudHMsWzAsMiwxXSkKI2dldF9ncm91cHMocm9ib3RpY3MsWzEwXSkKI2dldF9ncm91cHMod2ViLFswLDAsMCwyXSkKI2dldF9ncm91cHMoaWJtYXRoMixbMCwxLDJdKQojZ2V0X2dyb3VwcyhzaXh0aGdpcmxzLFswLDEsNF0pCiNmb3Igc3R1ZGVudHMgaW4gY2xhc3NfbmFtZToKIwlwcmludCBzdHVkZW50cwojZ2V0X2dyb3VwcyhnZW8yLFswLDAsMCw0XSkKCgoK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import random

#These are the lists of my students' names for each class.
robotics_students = ['thomas','cherry','junbo','daphine','min-xiu','kevin','elena']
math9 = ['benny','min','jack','sophia','diya','candice','manar','jenifer','yu-kyung','christian','pietro','andrew','jun-yu']
aa_students = ['yu-chung','max','kevin','karen','lucinda','xenia','apolline','jesse']
#advisory = ['flo', 'sam', 'jessie', 'maiti',  'min-xiu', 'paul', 'thomas','noah','yun-zhi']
ibmath2= ['vanessa','alex','shane','jun-hao','rodick','elena','suki','daphine']
physics = ['min-xiu','jessie','thomas','yun-zhi']
ibmath1 = ['emma','karen','xenia','kevin','lucinda','carmen','nirvaan','saarthak']
geo2 = ['steve','carmen','lianne','jason','yu-chung','kim','robin','apolline','kevinkang','kevinpark','sam','julius','nirvaan','junbo','chris','caroline']
web = ['andrea','jenifer','sahil','vadim','simon','jia-hui','prachi','william']
guys = ['paul','minxiu','noah','thomasW','rahul','isaac','thomasL','jakob','ian']
girls = ['emilly','jane','sam','jessie','maiti','flo','maddie','cherry','christine','jenny','amy','celine']
robotics=['daniel','luke','prachi','taeuk','kale','jung-woo','jake','choon-wun','dominick','alex']
sixthboys = ['kevin','charlie','jerry','mathias','lucas','veikka','jacky','james','jack','min-sang','ray']
sixthgirls = ['nillkie','manon','jarul','ho-jeong','rachel L','khushi','elena','angela','amy','anaelle','aanchal','rachel S','suhani','sunny']
msrobots=['alan','lucas','ha-vi','jennie','james','charlie','jarul','benjamin','jae-woo','kevin','jack','madhu','jeffrey','alex']
la = ['jemmy','ho-jeong','jae-woo','rachel','elena','amy','anaelle','yeon-woo','suhani','grace','jack','min-sang']
ibmathB = ['kim','jenny','kenna','jerry','judy','uijin','ying ying','simon','linh','kaithe','soohyeon','dao','doanh','thy','stella','kevin','nhu','nirat','hanna','b.y.']
precalcC = ['tran','jen','melissa','ka roi','may','anne','dan dan','kun','minseok','jacob','alex','lucia','sungjin','junhyung']
ibmathF =['sierra','vona','natalie','lea','steffi','j.s.','josh','sean','hang','david b','david v','peter','erina','john']
alg2=["kristy","kaitlan","tina","bunny","haryoung","jiyoon","gia-bao","andy","ben","zach","nantha","uyen"]
precalcE = ['minju','jaewon','san-san','sumin','emily','jae-young','thao-my','don','chia yo','nhu','eun-sol','ye bin','chan','angeline','keiji','celine','ellen','lauren','carrie','caden','an thi','jiyoun']
advisory = ['angel','tommy','mai','jiyoon','alina','ruby','marielle','jeongwoo','jihwan','frannie','angie']

#Scroll down to the line marked ENTER INFORMATION HERE - this is all the formulation of my grouping algorithm.

def get_groups(names,parameters):
        total = 0
        i = 0
        output = []
        for item in parameters:
                i = i + 1
                total = total + i*parameters[i-1]
        if (total!=len(names)):
                print ('Parameters not set correctly')
        else:
                random.shuffle(names)
                random.shuffle(names)
                random.shuffle(names)
                random.shuffle(names)
                random.shuffle(names)
                                                                            
                i = 0
                curr_index = 0
                num = 1
                for item in parameters:


                        if (item!=0):
                                
                                for i in range(0,item):
                                        temp_group = names[0:num]
                                        output.append(temp_group)
                                        del names[0:num]
                        num +=1
        groupIndex = 1                        
        for group in output:
                print("Group "+str(groupIndex)+":")
                groupString=""
                for name in group:
                        groupString+=(name+",")
                print (groupString)
                groupIndex+=1
                        
#ENTER INFORMATION HERE
get_groups(precalcE,[0,0,2,4])
#get_groups(alg2,[0,0,4])
#get_groups(ibmathF,[0,0,2,2])
#get_groups(ibmathB,[0,0,4,2])
#get_groups(precalcC,[0,0,3,1]) 
#get_groups(math9,[0,0,2,2])
#get_groups(math9,[0,0,3,1]) 
#get_groups(sixthboys,[0,1,3])
#get_groups(sixthgirls,[0,1,4])
#get_groups(ibmath1,[0,0,0,2])
#get_groups(aa_students,[8])
#get_groups(physics,[4])
#get_groups(advisory,[0,1,3])
#get_groups(calculus,[11,0,0])
#get_groups(msrobots,[0,0,2,2])                
#get_groups(robotics_students,[0,2,1])
#get_groups(robotics,[10])
#get_groups(web,[0,0,0,2])
#get_groups(ibmath2,[0,1,2])
#get_groups(sixthgirls,[0,1,4])
#for students in class_name:
#	print students
#get_groups(geo2,[0,0,0,4])