當前位置: 首頁>>代碼示例>>Python>>正文


Python names.get_full_name方法代碼示例

本文整理匯總了Python中names.get_full_name方法的典型用法代碼示例。如果您正苦於以下問題:Python names.get_full_name方法的具體用法?Python names.get_full_name怎麽用?Python names.get_full_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在names的用法示例。


在下文中一共展示了names.get_full_name方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: GenerateName

# 需要導入模塊: import names [as 別名]
# 或者: from names import get_full_name [as 別名]
def GenerateName():
	"""
	Stupid wrapper.
	:return: Name. Duha!
	"""
	return names.get_full_name() 
開發者ID:ytisf,項目名稱:PyExfil,代碼行數:8,代碼來源:data_generator.py

示例2: gen_user

# 需要導入模塊: import names [as 別名]
# 或者: from names import get_full_name [as 別名]
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)) 
開發者ID:okpy,項目名稱:ok,代碼行數:14,代碼來源:generate.py

示例3: sessione_utente

# 需要導入模塊: import names [as 別名]
# 或者: from names import get_full_name [as 別名]
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 
開發者ID:CroceRossaItaliana,項目名稱:jorvik,代碼行數:33,代碼來源:utils_tests.py

示例4: readResultFolder

# 需要導入模塊: import names [as 別名]
# 或者: from names import get_full_name [as 別名]
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 
開發者ID:Gab0,項目名稱:japonicus,代碼行數:51,代碼來源:japonicusResultSelector.py


注:本文中的names.get_full_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。