S@f HddlZejdGddZdS)NicheZdZddZdZdZdZdd Zdd Zdd Z dd Z dd Z ddZ ddZ ddZdS)TestreturnNc`t|_t|_||_dSN)set connections names_usedusers)selfr s 7/home/robert/Desktop/SD/sd-tema-3/generator/commands.py__init__z Test.__init__s$55%% c4tj|jSr)randomchoicer )r s r get_namez Test.get_name s}TZ(((rczt|j}|tj|Sr)listr sortrr)r lsts r get_existing_namezTest.get_existing_names.4?##  }S!!!rc,tj||Sr)rrandint)r bottomtops r get_randomzTest.get_randoms~fc***rTFc|r|jn|j}||n |}||n |}||f}|rV||kr|}||k||jvr7|}|}||kr|}||k||f}||jv7||jvrdS|j||j||f|j||j|d|d|||fS)Nzadd  )rrr addr )r name1name2generate useExistinggetter name_tuples r generate_addzTest.generate_adds^+6I''DM**U^  ,5..5.. 000unn"FHHEunn$U^  000 ) ) )2 Z((( eU^,,, E""" E"""%e%%e%%ue33rc||||fntj|j}|j|d|d|||fS)Nzremove r )rrr remove)r r"r# named_tuples r generate_removezTest.generate_remove4s`(-(9e>Ouennt/00   ,,,(((((%66rc||n|}||n|}|r"||kr|}|r||kd|d|||fS)Nz distance r rrr r"r# is_uniques r generate_distancezTest.generate_distance<s*0F0F0H0H*0F0F0H0H $EUNNMMOOE $EUNN+5**5**E588rc@||n|}d||fS)Nz suggestions rr r"s r generate_suggestionszTest.generate_suggestionsEs/*0F0F0H0H%e%%u,,rc@||n|}d||fS)Nzfriends r3r4s r generate_friendszTest.generate_friendsJ/*0F0F0H0H!%!!5((rc||n|}||n|}|r"||kr|}|r||kd|d|||fS)Nzcommon r r.r/s r generate_commonzTest.generate_commonOs*0F0F0H0H*0F0F0H0H $EUNNMMOOE $EUNN)((((%66rc@||n|}d||fS)Nzpopular r3r4s r generate_popularzTest.generate_popularXr8rc v||n}d}|rttfdt|dz D}||||D]0}|D]+}||kr ||\}} } ||dz },1|d||fS)Nrc8g|]}S)r).0_r s r z(Test.generate_clique..bs!GGG!dmmooGGGrr= z common-group )rrrrangeappendrr() r r"r$sizeresultnamesnameFstnameSndmsgrBs ` r generate_cliquezTest.generate_clique]s*0F0F0H0H  )GGGGuTAXGGGHHIIE LL    JJLLL  ) )$))G')) $ 1 1'7 C CICAjjj(FF )..u..55r)rN)NNTF)NN)NNTr)NTr=)__name__ __module__ __qualname__rrrrr(r,r1r5r7r:r<rMr@rr rrs )))""" +++4444<77779999---- )))) 7777)))) 666666rr)rseedrr@rr rRs\  Ci6i6i6i6i6i6i6i6i6i6r