Python names.get_full_name() Examples

The following are 4 code examples of names.get_full_name(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module names , or try the search function .
Example #1
Source File: data_generator.py    From PyExfil with MIT License 5 votes vote down vote up
def GenerateName():
	"""
	Stupid wrapper.
	:return: Name. Duha!
	"""
	return names.get_full_name() 
Example #2
Source File: generate.py    From ok with Apache License 2.0 5 votes vote down vote up
def gen_user():
    real_name = names.get_full_name()
    first_name, last_name = real_name.lower().split(' ')
    return User(
        name=gen_maybe(real_name, 0.5),
        email='{0}{1}{2}{3}@{4}'.format(
            random.choice([first_name, first_name[0]]),
            random.choice(string.ascii_lowercase) if gen_bool() else '',
            random.choice([last_name, last_name[0]]),
            random.randrange(10) if gen_bool() else '',
            random.choice(['berkeley.edu', 'gmail.com'])),
        is_admin=gen_bool(0.05)) 
Example #3
Source File: utils_tests.py    From jorvik with GNU General Public License v3.0 5 votes vote down vote up
def sessione_utente(server_url, persona=None, utente=None, password=None, wait_time=7):
    if not (persona or utente):
        raise ValueError("sessione_utente deve ricevere almeno una persona "
                         "o un utente.")

    if persona:
        try:
            utenza = persona.utenza
        except:
            utenza = crea_utenza(persona=persona, email=email_fittizzia(),
                                 password=names.get_full_name())

    elif utente:
        utenza = utente

    try:
        password_da_usare = password or utenza.password_testing

    except AttributeError:
        raise AttributeError("L'utenza è già esistente, non ne conosco la password.")

    sessione = crea_sessione(wait_time)
    sessione.visit("%s/login/" % server_url)
    sessione.fill("auth-username", utenza.email)
    sessione.fill("auth-password", password_da_usare)
    sessione.find_by_xpath('//button[@type="submit"]').first.click()

    # Assicurati che il login sia riuscito.
    assert sessione.is_text_present(utenza.persona.nome)

    return sessione 
Example #4
Source File: japonicusResultSelector.py    From japonicus with MIT License 4 votes vote down vote up
def readResultFolder(strategyName, runLogFolderPath, retrievalCount=1):
    evalBreaksLogFilename = os.path.join(runLogFolderPath, 'evaluation_breaks.csv')
    if not os.path.isfile(evalBreaksLogFilename):
        print("Evaluation break log file not found.")
        return False

    evalBreakLogs = open(evalBreaksLogFilename)

    evalBreakLogs = csv.DictReader(evalBreakLogs)

    positiveResults = []
    for result in evalBreakLogs:
        if result['evaluation'] > 0 and result['secondary'] > 0:
            if len(list(result.keys())) > 2:
                result['score'] = result['evaluation'] + result['secondary']
                positiveResults.append(result)
            else:
                print("Naive logging system detected, from older japonicus version.")
                print("Unable to check result file.")

    if not positiveResults:
        print("No positive results found!")
        return False

    positiveResults = sorted(positiveResults,
                             key=lambda r: r['score'], reverse=True)


    parameterName = strategyName + names.get_full_name()

    R = positiveResults[0]
    stratPath = os.path.join(R['filepath'])
    shutil.copy()

    strategyRankings = exchangeMonitor.loadStrategyRankings()

    newEntry = exchangeMonitor.strategyParameterSet(
        {
            'strategy': strategyName,
            'parameters': parameterName,
            'profits': []
        }
    )

    strategyRankings.append(newEntry)

    exchangeMonitor.saveStrategyRankings(strategyRankings)
    
    return True