def __init__(self, servers, username=None, password=None, timeout=10, session=None,
                 auth_token=None, verify=True, sse_session=None):
        """Create a MarathonClient instance.

        If multiple servers are specified, each will be tried in succession until a non-"Connection Error"-type
        response is received. Servers are expected to have the same username and password.

        :param servers: One or a priority-ordered list of Marathon URLs (e.g., 'http://host:8080' or
        ['http://host1:8080','http://host2:8080'])
        :type servers: str or list[str]
        :param str username: Basic auth username
        :param str password: Basic auth password
        :param requests.session session: requests.session for reusing the connections
        :param int timeout: Timeout (in seconds) for requests to Marathon
        :param str auth_token: Token-based auth token, used with DCOS + Oauth
        :param bool verify: Enable SSL certificate verification
        :param requests.session sse_session: requests.session for event stream connections, which by default enables tcp keepalive
        """
        if session is None:
            self.session = requests.Session()
        else:
            self.session = session
        if sse_session is None:
            self.sse_session = requests.Session()
            keep_alive = socket_options.TCPKeepAliveAdapter()
            self.sse_session.mount('http://', keep_alive)
            self.sse_session.mount('https://', keep_alive)
        else:
            self.sse_session = sse_session
        self.servers = servers if isinstance(servers, list) else [servers]
        self.auth = (username, password) if username and password else None
        self.verify = verify
        self.timeout = timeout

        self.auth_token = auth_token
        if self.auth and self.auth_token:
            raise ValueError("Can't specify both auth token and username/password. Must select "
                             "one type of authentication.")
def __init__ ( self , servers , username = None , password = None , timeout = 10 , session = None , auth_token = None , verify = True , sse_session = None ) : if session is None : self . session = requests . Session ( ) else : self . session = session if sse_session is None : self . sse_session = requests . Session ( ) keep_alive = socket_options . TCPKeepAliveAdapter ( ) self . sse_session . mount ( 'http://' , keep_alive ) self . sse_session . mount ( 'https://' , keep_alive ) else : self . sse_session = sse_session self . servers = servers if isinstance ( servers , list ) else [ servers ] self . auth = ( username , password ) if username and password else None self . verify = verify self . timeout = timeout self . auth_token = auth_token if self . auth and self . auth_token : raise ValueError ( "Can't specify both auth token and username/password. Must select " "one type of authentication." )
Create a MarathonClient instance.

        If multiple servers are specified, each will be tried in succession until a non-"Connection Error"-type
        response is received. Servers are expected to have the same username and password.

        :param servers: One or a priority-ordered list of Marathon URLs (e.g., 'http://host:8080' or
        ['http://host1:8080','http://host2:8080'])
        :type servers: str or list[str]
        :param str username: Basic auth username
        :param str password: Basic auth password
        :param requests.session session: requests.session for reusing the connections
        :param int timeout: Timeout (in seconds) for requests to Marathon
        :param str auth_token: Token-based auth token, used with DCOS + Oauth
        :param bool verify: Enable SSL certificate verification
        :param requests.session sse_session: requests.session for event stream connections, which by default enables tcp keepalive