本文整理匯總了Python中team.Team.team_with_user方法的典型用法代碼示例。如果您正苦於以下問題:Python Team.team_with_user方法的具體用法?Python Team.team_with_user怎麽用?Python Team.team_with_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類team.Team
的用法示例。
在下文中一共展示了Team.team_with_user方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: top_trading_cycles
# 需要導入模塊: from team import Team [as 別名]
# 或者: from team.Team import team_with_user [as 別名]
def top_trading_cycles(teams,users):
while teams:
graph = {}
for team in teams:
for user in team.user_prefs(users):
if(Team.team_with_user(teams,user)):
graph[team] = (Team.team_with_user(teams,user),user)
break
cycles = detect_cycles(graph)
for cycle in cycles:
for team in cycle:
team.take_user_from(graph[team][0],graph[team][1])
for team in cycle:
teams.pop(teams.index(team))