示例#1
0
文件: func.py 项目: icactus13/babka
def create_npc(loc, gender, level, mood):
    """ Create NPC

    Args:
        loc (int): Location
        gender (string): gender
        level (int): NPC level
        mood (int): NPC mood

    Returns:
        class: NPC
    """
    if gen_names == "neuro":
        name = get_name(gender)
    else:
        name = random_name(gender)
    return NPC(name, gender, level, loc, mood)
示例#2
0
文件: func.py 项目: icactus13/babka
def create_name():
    """Create Babka's name
    if no name is specified, the function will generate a random name.

    Returns:
        string: Generated Babka's name
    """
    menu.print_title('Создание бабки')
    print('Если имя не будет введено, то будет сгенерировано случайное имя.')
    name = input('Введи имя: ')
    if not name:
        print('Хорошо, я сгенерирую рандомное имя для бабки...')
        if gen_names == "neuro":
            name = get_name('female')
        else:
            name = random_name('female')
        print('Имя бабки: ', name)
        return name
    elif is_string(name):
        print("Хорошо!")
        return name
示例#3
0
def main():
    while True:
        answer = input("Do you want to generate another character? y/n \n")
        if answer == 'y':
            generating()
            print_out()
            re_roll()
            print(my_char)
            name = get_name()
            print(name)
            print(str(my_char) + "\n")
            strn, dext, cons, wisd, inte, cha_ism = lets_go()
            print(f"{strn} \n\n")
            with open("char.txt", "a+") as file:
                file.write(name + "\n")
                file.write(str(my_char) + "\n")
                file.write(str() + "\n\n")
        elif answer == 'n':
            print("See you later, stranger")
            break
        else:
            print("The input should be 'y' or 'n' \n")
示例#4
0
import tensorflow as tf
import numpy as np
import pandas as pd
import functools
import datetime
import os
import name_gen as ng
import gensim
np.random.seed(1000)

DTYPE = 'float32'
RUN_NAME = ng.get_name()
LOG_DIR = '/home/xuri3814/data/clickbait/cnn/runs/logs/{}/'.format(RUN_NAME)
CHECKPOINT_DIR = '/home/xuri3814/data/clickbait/cnn/runs/checkpoints/{}/'.format(RUN_NAME)
DATA_DIR = '/home/xuri3814/data/clickbait/'

import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"   # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"] = "0"


def lazy_property(function):
    """
    http://danijar.com/structuring-your-tensorflow-models/
    http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/
    paper: http://arxiv.org/abs/1408.5882
    :param function:
    :return:
    """
    attribute = '_cache_' + function.__name__