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