Associate keys with teams
491650
function afterFindTeams(err, teamData){
		var teamList = {};

		// Load teams and assing it's key as it's id
		teamData.forEach(function(team){
			teamList[team.id] = team;
		});

		// Includes team object in 'table' data
		data.forEach(function(group){

			// console.log(group);
			// Go trough all the table adding key 'team' with team data
			_.forEach(group.table, function(row){
				row.team = teamList[row.teamId];
			});
		});

		// Includes team object in 'match' data
		data.forEach(function(group){

			// console.log(group);
			// Go trough all the table adding key 'team' with team data
			_.forEach(group.matches, function(row){
				row.teamA = teamList[row.teamAId];
				row.teamB = teamList[row.teamBId];
			});
		});

		next(data);
	}
1232313
def team_players(self, team):
        """"""
        headers = ['Jersey Number', 'Name', 'Position', 'Nationality',
                   'Date of Birth']
        result = [headers]

        result.extend([player['shirtNumber'],
                       player['name'],
                       player['position'],
                       player['nationality'],
                       player['dateOfBirth']]
                      for player in team)
        self.generate_output(result)
663768
def team_status(self, team, event):
        
        return Status(self._get('team/%s/event/%s/status' % (self.team_key(team), event)))
114969
def users(self, team, params={}, **options): 
        
        path = "/teams/%s/users" % (team)
        return self.client.get_collection(path, params, **options)
500166
public static function selectTeamItem(
        $statisticState,
        $teamKey
    ) {
        $statisticState = (object) $statisticState;
        $teamKey = (string) $teamKey;

        $teamItem = $statisticState->team->$teamKey;

        return $teamItem;
    }
1250415
public void connect() {
        CommandFactory f = new CommandFactory();
        f.addCoachInitCommand(teamName);
        initMessage = f.next();
        super.start();
        super.setName(teamName + " Coach");
    }
1038488
function processGroupsKeys(){
				var GroupsKeys = [];
				var MatchKeys = [];

				module.groups.forEach(function(group){
					GroupsKeys.push({
						value: group.get('id'),
						text: group.get('name'),
					});

					group.get('matches').forEach(function(match){
						var title = group.get('name') + ': ';
						title += match.teamA ? match.teamA.name : '[?]';
						title += ' x ';
						title += match.teamB ? match.teamB.name : '[?]';

						MatchKeys.push({
							value: match.id,
							text: title,
						});
					});
				});

				module.GroupsKeys = GroupsKeys;
				module.MatchKeys = MatchKeys;
			}
847372
def part_key(exp, alt, date_hour=nil)
      parts = [ "participants", exp.name, alt ]
      parts += [ date_hour.date, date_hour.hour ] unless date_hour.nil?
      make_key parts
    end
1142965
function(match, $root){

			// Title bar
			$root.find('.timer').text(match.group.name);
			$root.find('.field-title').text('FIELD');
			$root.find('.field').text(match.field);

			// Content area
			var teamAName = match.teamA ? match.teamA.name : '-';
			$root.find('.team.left .team-name').text(teamAName);

			var teamBName = match.teamB ? match.teamB.name : '-';
			$root.find('.team.right .team-name').text(teamBName);
			
		}
511304
public void setupKeys()
    {
        KeyAreaInfo keyArea = null;
        keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY);
        keyArea.addKeyField(ID, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.UNIQUE, USER_GROUP_ID_KEY);
        keyArea.addKeyField(USER_GROUP_ID, Constants.ASCENDING);
        keyArea.addKeyField(USER_RESOURCE_ID, Constants.ASCENDING);
        keyArea.addKeyField(LOGIN_LEVEL, Constants.ASCENDING);
        keyArea = new KeyAreaInfo(this, Constants.UNIQUE, USER_RESOURCE_ID_KEY);
        keyArea.addKeyField(USER_RESOURCE_ID, Constants.ASCENDING);
        keyArea.addKeyField(USER_GROUP_ID, Constants.ASCENDING);
        keyArea.addKeyField(LOGIN_LEVEL, Constants.ASCENDING);
    }
1180387
private void addGroup(String key, Group object) {
    int fieldIndex = getIndex(key);
    this.schema.getType(fieldIndex).asGroupType();
    this.data[fieldIndex].add(object);
  }
1211519
def get_event_teams(self, id, **data):
        
        
        return self.get("/events/{0}/teams/".format(id), data=data)
1241377
def is_in_team(self, team_id):
        """"""

        if self.is_super_admin():
            return True
        team_id = uuid.UUID(str(team_id))
        return team_id in self.teams or team_id in self.child_teams_ids
761426
def addGroupsToKey(server, activation_key, groups):
    '''
    
    '''

    try:
        client, key = _get_session(server)
    except Exception as exc:
        err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
        log.error(err_msg)
        return {'Error': err_msg}

    all_groups = client.systemgroup.listAllGroups(key)
    groupIds = []
    for group in all_groups:
        if group['name'] in groups:
            groupIds.append(group['id'])

    if client.activationkey.addServerGroups(key, activation_key, groupIds) == 1:
        return {activation_key: groups}
    else:
        return {activation_key: 'Failed to add groups to activation key'}
663857
def associate_keys(user_dict, client):
    
    added_keys = user_dict['keypairs']

    print ">>>Updating Keys-Machines association"
    for key in added_keys:
        machines = added_keys[key]['machines']
        if machines:
            try:
                for machine in machines:
                    cloud_id = machine[0]
                    machine_id = machine[1]
                    ssh_user = machine[3]
                    ssh_port = machine[-1]
                    key = client.keys[key]
                    cloud = cloud_from_id(client, cloud_id)
                    cloud.update_machines()
                    mach = machine_from_id(cloud, machine_id)
                    public_ips = mach.info.get('public_ips', None)
                    if public_ips:
                        host = public_ips[0]
                    else:
                        host = ""
                    key.associate_to_machine(cloud_id=cloud_id, machine_id=machine_id, host=host, ssh_port=ssh_port,
                                             ssh_user=ssh_user)

                    print "associated machine %s" % machine_id
            except Exception as e:
                pass
    client.update_keys()
    print
1135140
def attach_team(context, id, team_id):
    
    team_id = team_id or identity.my_team_id(context)
    result = topic.attach_team(context, id=id, team_id=team_id)
    utils.format_output(result, context.format)
753967
def team_id(team, org)
      /^\d+$/.match(team.to_s) ? team : team_id_by_slug(team, org)
    end