def get_leagues_by_team(team_ids):
    # Can only have 10 teams max if it's a list
    if isinstance(team_ids, list) and len(team_ids) > 10:
        raise ValueError("Can only get leagues for up to 10 teams at once.")

    id_string = ",".join(team_ids) if isinstance(team_ids, list) else str(team_ids)

    # Get JSON response
    request = "{version}/league/by-team/{ids}".format(version=cassiopeia.dto.requests.api_versions["league"], ids=id_string)
    response = cassiopeia.dto.requests.get(request)

    # Convert response to Dto type
    for id_, leagues in response.items():
        response[id_] = [cassiopeia.type.dto.league.League(league) for league in leagues]

    return response
https://developer.riotgames.com/api/methods#!/985/3352
dataset/ETHPy150Open meraki-analytics/cassiopeia/cassiopeia/dto/leagueapi.py/get_leagues_by_team