fpl/models/user.py
async def substitute(self, players_in, players_out, captain=None,
                         vice_captain=None):
        """Substitute players on the bench for players in the starting eleven.
        Also allows the user to simultaneously set the new (vice) captain(s).
        A maximum of 4 substitutes is set to force proper usage.

        :param players_in: List of IDs of players who will be substituted in.
        :type players_in: list
        :param players_out: List of IDS of players who will be substituted out.
        :type players_out: list
        :param captain: ID of the captain, defaults to None.
        :param captain: int, optional
        :param vice_captain: ID of the vice captain, defaults to None.
        :param vice_captain: int, optional
        """
        if not logged_in(self._session):
            raise Exception("User must be logged in.")

        if len(players_out) > 4 or len(players_in) > 4:
            raise Exception("Can only substitute a maximum of 4 players.")

        if len(players_out) != len(players_in):
            raise Exception("Number of players substituted in must be same as "
                            "number substituted out.")

        if not set(players_in).isdisjoint(players_out):
            raise Exception("Player ID can't be in both lists.")

        user_team = await self.get_team()
        team_ids = [player["element"] for player in user_team]
        substitution_ids = players_out + players_in

        if not set(substitution_ids).issubset(team_ids):
            raise Exception(
                "Cannot substitute players who aren't in the user's team.")

        # Set new captain or vice captain if applicable
        if captain:
            _set_captain(user_team, captain, is_c, team_ids)

        if vice_captain:
            _set_captain(user_team, vice_captain, is_vc, team_ids)

        lineup = await self._create_new_lineup(
            players_in, players_out, user_team)

        await self._post_substitutions(lineup)
Substitute players on the bench for players in the starting eleven.
        Also allows the user to simultaneously set the new (vice) captain(s).
        A maximum of 4 substitutes is set to force proper usage.

        :param players_in: List of IDs of players who will be substituted in.
        :type players_in: list
        :param players_out: List of IDS of players who will be substituted out.
        :type players_out: list
        :param captain: ID of the captain, defaults to None.
        :param captain: int, optional
        :param vice_captain: ID of the vice captain, defaults to None.
        :param vice_captain: int, optional
        
Substitute players on the bench for players in the starting eleven.
Also allows the user to simultaneously set the new (vice) captain(s).
A maximum of 4 substitutes is set to force proper usage.
Substitute players on the bench for players in the starting eleven . Also allows the user to simultaneously set the new ( vice ) captain ( s ) . A maximum of 4 substitutes is set to force proper usage .
async def substitute(self, players_in, players_out, captain=None,
                         vice_captain=None):
        if not logged_in(self._session):
            raise Exception("User must be logged in.")
        if len(players_out) > 4 or len(players_in) > 4:
            raise Exception("Can only substitute a maximum of 4 players.")
        if len(players_out) != len(players_in):
            raise Exception("Number of players substituted in must be same as "
                            "number substituted out.")
        if not set(players_in).isdisjoint(players_out):
            raise Exception("Player ID can't be in both lists.")
        user_team = await self.get_team()
        team_ids = [player["element"] for player in user_team]
        substitution_ids = players_out + players_in
        if not set(substitution_ids).issubset(team_ids):
            raise Exception(
                "Cannot substitute players who aren't in the user's team.")
        if captain:
            _set_captain(user_team, captain, is_c, team_ids)
        if vice_captain:
            _set_captain(user_team, vice_captain, is_vc, team_ids)
        lineup = await self._create_new_lineup(
            players_in, players_out, user_team)
        await self._post_substitutions(lineup)
async def substitute ( self , players_in , players_out , captain = None , vice_captain = None ) : if not logged_in ( self . _session ) : raise Exception ( "User must be logged in." ) if len ( players_out ) > 4 or len ( players_in ) > 4 : raise Exception ( "Can only substitute a maximum of 4 players." ) if len ( players_out ) != len ( players_in ) : raise Exception ( "Number of players substituted in must be same as " "number substituted out." ) if not set ( players_in ) . isdisjoint ( players_out ) : raise Exception ( "Player ID can't be in both lists." ) user_team = await self . get_team ( ) team_ids = [ player [ "element" ] for player in user_team ] substitution_ids = players_out + players_in if not set ( substitution_ids ) . issubset ( team_ids ) : raise Exception ( "Cannot substitute players who aren't in the user's team." ) if captain : _set_captain ( user_team , captain , is_c , team_ids ) if vice_captain : _set_captain ( user_team , vice_captain , is_vc , team_ids ) lineup = await self . _create_new_lineup ( players_in , players_out , user_team ) await self . _post_substitutions ( lineup )
Substitute players on the bench for players in the starting eleven.
Substitute players on the bench for players in the starting eleven .
"""Substitute players on the bench for players in the starting eleven.
        Also allows the user to simultaneously set the new (vice) captain(s).
        A maximum of 4 substitutes is set to force proper usage.

        :param players_in: List of IDs of players who will be substituted in.
        :type players_in: list
        :param players_out: List of IDS of players who will be substituted out.
        :type players_out: list
        :param captain: ID of the captain, defaults to None.
        :param captain: int, optional
        :param vice_captain: ID of the vice captain, defaults to None.
        :param vice_captain: int, optional
        """ # Set new captain or vice captain if applicable
self
players_in
List of IDs of players who will be substituted in.
List of IDs of players who will be substituted in .
players_out
List of IDS of players who will be substituted out.
List of IDS of players who will be substituted out .
captain
None
vice_captain
None