本文整理汇总了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()
示例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))
示例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
示例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