def _add_challenges(pathname, outfile): with open(pathname, 'r') as ymlfile: chall_metadata = yaml.safe_load(ymlfile) if type(chall_metadata) != list: chall_metadata = [chall_metadata] js_category = js(pathname.split(os.sep)[1]) path = os.path.split(pathname)[0] n = 0 for c in chall_metadata: name = js('<a href="{}">{}</a>'.format(path, c['name'])) ctf = js(c.get('ctf', '')) author = js(c.get('author', '')) difficulty = js(c.get('difficulty', '')) tags = js(c.get('tags', '')) notes = js(c.get('notes', '')) original_writeup_html = _process_writeup_list(c['original_writeups'], 'Original') backup_writeups = c['backup_writeups'] if type(backup_writeups) != list: backup_writeups = [backup_writeups] backup_writeup_html = _process_writeup_list( [os.path.join(path, bw) for bw in backup_writeups], 'Backup') writeup_html = original_writeup_html + backup_writeup_html print( "{{name: {}, ctf: {}, author: {}, category: {}, tags: {}, difficulty: {}, writeup: '{}', notes: {}}}," .format(name, ctf, author, js_category, tags, difficulty, writeup_html, notes), file=outfile) n += 1 return n
def megaFaker(): with open('1000.json', 'r') as handle: milSemillas = js(handle) palabras = [ "como ", "cuando ", "donde queda ", "como encontrar ", "que hacer en ", "obtener " ] categoria = [ "animal", "carmodle", "moviesTitle", "NameOfCompany", "Drug", "uni", "apps" ] rCategoria = (str(categoria[rd(0, 6)])) rSemilla = (np(milSemillas)[rd(1, 100)][rCategoria]) rPalabras = (str(palabras[rd(0, 5)])) return (str(rPalabras + rSemilla))
def ep(new_update, context): """Точка входа для AWS Lambda""" # FIXME: как избавиться от перевода в json строку и обратно? # Нужно избавиться от лишнего импорта json-а bot.process_new_updates([types.Update.de_json(js(new_update))])
def megaFaker(): try: with open('1000.json', 'r') as milSemillas: milSemillas = js(milSemillas) except Exception as e: print(str(e) + "< Archivo no existe!") exit() categoria = [ "animal", "carmodle", "moviesTitle", "NameOfCompany", "uni", "apps" ] rCategoria = (str(categoria[rd(0, (len(categoria)) - 1)])) #####################Entrenar IA mejor dese txt############# if (rCategoria == "animal"): palabras = [ "donde encontar ", "habita ", "comida ", "peloigro de extinción ", "venenoso ", "composicion osea ", ] elif (rCategoria == "carmodle"): palabras = [ "que es ", "a que sabe ", "donde queda ", "como encontrar ", "ver " ] elif (rCategoria == "moviesTitle"): palabras = [ "fecha de lanzamiento de ", "reparto en ", "secuelas de ", "resumen ", "protagonista en ", "elenco de ", "descargar de ", "animacion de ", "calidad de ", "cinematic de ", "musica de ", "esenario en ", "Historia en", "catetgoria de la ", "errores de la ", "trama de", "arte de ", "libro de ", "escritor de ", "gion de ", "etapas de ", ] elif (rCategoria == "NameOfCompany"): palabras = [ "fecha de creacion ", "competencia de la ", "estrategia de la ", "vision de la ", "mision de la ", "capacidad de trabajadores ", "beneficios de la ", ] elif (rCategoria == "uni"): palabras = [ "requisitos para entara en ", "carrera ", "donde queda la ", "como encontrar la ", "que hacer en la ", "obtener beca en la " ] if (rCategoria == "apps"): palabras = [ "Version ", "git ", "licencia ", "como encontrar ", "que hacer en la ", "animacion ", "keys ", "free ", "gratis ", "obtener ", "descargar " ] rSemilla = np(milSemillas)[rd(0, 999)][rCategoria] rPalabras = str(palabras[rd(0, (len(palabras)) - 1)]) #################### Documentacion ####################### global rn doc = """ --------------------Thankas for play!----------- Al azar python3 Tiempo segunso = [{}] Tiempo minutos = [{}] Tema = [{}] Categoria = [{}] Accion a concatenar = [{}] cantidad de palabras = [{}] ------------------------------------------------ """.format(rn(), (str(rn() / 60)), rCategoria, rSemilla, rPalabras, (len(milSemillas))) print(doc) ########################################################## palaGenerada = str(rPalabras + rSemilla) #lis.append(palaGenerada) return (str(rPalabras + rSemilla))
def megaFaker(): with open('1000.json', 'r') as milSemillas: milSemillas=js(milSemillas) categoria =[ "animal", "carmodle", "moviesTitle", "NameOfCompany", "uni", "apps" ] rCategoria = (str(categoria[rd(0,(len(categoria))-1)])) #####################Entrenar IA mejor dese txt############# if(rCategoria=="animal"): palabras=[ "donde encontar ", "habita ", "comida ", "peloigro de extinción ", "venenoso ", "composicion osea ", ] elif(rCategoria=="carmodle"): palabras=[ "que es ", "a que sabe ", "donde queda ", "como encontrar ", "ver "] elif(rCategoria=="moviesTitle"): palabras=[ "fecha de lanzamiento de ", "reparto en ", "secuelas de ", "resumen ", "protagonista en ", "elenco de ", "descargar de ", "animacion de ", "calidad de " , "cinematic de ", "musica de " , "esenario en ", "Historia en" , "catetgoria de la " , "errores de la " , "trama de" , "arte de " , "libro de " , "escritor de " , "gion de " , "etapas de ", ] elif(rCategoria=="NameOfCompany"): palabras=[ "fecha de creacion ", "competencia de la ", "estrategia de la ", "vision de la ", "mision de la ", "capacidad de trabajadores ", "beneficios de la ", ] elif(rCategoria=="uni"): palabras=[ "requisitos para entara en ", "carrera ", "donde queda la ", "como encontrar la ", "que hacer en la ", "obtener beca en la " ] if(rCategoria=="apps"): palabras=[ "Version ", "git ", "licencia ", "como encontrar ", "que hacer en la ", "animacion ", "keys ", "free ", "gratis ", "obtener ", "descargar " ] rSemilla = np(milSemillas)[rd(0,999)][rCategoria] rPalabras = str(palabras[rd(0,(len(palabras))-1)]) return(str(rPalabras+rSemilla))