Takes in a list of players ids and divide them by league tiers.
    :param summoner_ids: a list containing the ids of players
    :param queue: the queue to consider
    :return: a dictionary tier -> set of ids
182225
def leagues_by_summoner_ids(summoner_ids, queue=Queue.RANKED_SOLO_5x5):
    
    summoners_league = defaultdict(set)
    for start, end in _slice(0, len(summoner_ids), 10):
        for id, leagues in get_league_entries_by_summoner(summoner_ids[start:end]).items():
            for league in leagues:
                if Queue[league.queue]==queue:
                    summoners_league[Tier.parse(league.tier)].add(int(id))
    return summoners_league
103935
def atlas_peer_dequeue_all( peer_queue=None ):
    

    peers = []
    with AtlasPeerQueueLocked(peer_queue) as pq:
        while len(pq) > 0:
            peers.append( pq.pop(0) )

    return peers
469988
def get_for_accounts(self, accounts: List[Account]):
        '''  '''
        account_ids = [acc.guid for acc in accounts]
        query = (
            self.query
            .filter(Split.account_guid.in_(account_ids))
        )
        splits = query.all()
        return splits
251072
function f_ihaleIdsiniKaydet(_ihaleDunyasi_id) {
        return redis.dbQ.set(redis.kp.ihale.ihaleDunyasi.idx, parseInt(_ihaleDunyasi_id));
    }
507593
def get_from_category_qs(cls, category):
        
        ids = cls.get_ties_for_categories_qs(category).values_list('object_id').distinct()
        filter_kwargs = {'id__in': [i[0] for i in ids]}
        return cls.objects.filter(**filter_kwargs)
878942
def get_minions():
    '''
    
    '''
    with _get_serv(ret=None, commit=True) as cur:

        sql = '''SELECT DISTINCT id
                FROM `salt_returns`'''

        cur.execute(sql)
        data = cur.fetchall()
        ret = []
        for minion in data:
            ret.append(minion[0])
        return ret
390598
def item_id(response):
    
    dict_keys = ['item_0', 'item_1', 'item_2',
                 'item_3', 'item_4', 'item_5']
    new_keys = ['item_0_name', 'item_1_name', 'item_2_name',
                'item_3_name', 'item_4_name', 'item_5_name']

    for player in response['players']:
        for key, new_key in zip(dict_keys, new_keys):
            for item in items['items']:
                if item['id'] == player[key]:
                    player[new_key] = item['localized_name']

    return response
1358850
def reconstruct_queue(people):
    
    queue = []
    people.sort(key=lambda x: (-x[0], x[1]))
    for h, k in people:
        queue.insert(k, [h, k])
    return queue
93705
def setup_queue(name, ids = nil)
      queue = {:name => name, :options => {:durable => true, :no_declare => @options[:secure]}}
      filter = [:from, :tags, :tries, :persistent]
      options = {:ack => true, Push => filter, Request => filter, Result => [:from], :brokers => ids}
      @client.subscribe(queue, nil, options) { |_, packet, header| handle_packet(name, packet, header) }
    end
307560
def list_members(self, list_id):
        
        return [User(user._json) for user in self._client.list_members(list_id=list_id)]
377462
def get_all_team_ids():
    """"""
    df = get_all_player_ids("all_data")
    df = pd.DataFrame({"TEAM_NAME": df.TEAM_NAME.unique(),
                       "TEAM_ID": df.TEAM_ID.unique()})
    return df
489006
def ids2strids(ids: Iterable[int]) -> str:
    
    return C.TOKEN_SEPARATOR.join(map(str, ids))
985723
def get_known_subqueues(self):
        

        all_queues_from_mongodb = Queue.all_known(sources=("jobs", ))

        idprefix = self.id
        if not idprefix.endswith("/"):
            idprefix += "/"

        return {q for q in all_queues_from_mongodb if q.startswith(idprefix)}
1169518
def idPlayerResults(cfg, rawResult):
    """"""
    result = {}
    knownPlayers = []
    dictResult = {plyrRes.player_id : plyrRes.result for plyrRes in rawResult}
    for p in cfg.players:
        if p.playerID and p.playerID in dictResult: # identified player w/ result
            knownPlayers.append(p)
            result[p.name] = dictResult[p.playerID]
    #if len(knownPlayers) == len(dictResult) - 1: # identified all but one player
    #    for p in cfg.players: # search for the not identified player
    #        if p in knownPlayers: continue # already found
    #        result.append( [p.name, p.playerID, dictResult[p.playerID]] )
    #        break # found missing player; stop searching
    #for r in result:
    #    print("result:>", r)
    return result
729661
def find_ids(self, element_ids):
        
        elements = [_transform.FigureElement.find_id(self, eid)
                    for eid in element_ids]
        return Panel(*elements)
1342668
def _list_queues():
    '''
    
    '''
    queue_dir = __opts__['sqlite_queue_dir']
    files = os.path.join(queue_dir, '*.db')
    paths = glob.glob(files)
    queues = [os.path.splitext(os.path.basename(item))[0] for item in paths]

    return queues
1073038
def get_list_subtasks(client, list_id, completed=False):
    '''  '''
    params = {
            'list_id' : int(list_id),
            'completed' : completed,
            }
    response = client.authenticated_request(client.api.Endpoints.SUBTASKS, params=params)
    return response.json()