def get_session(self, bearer_token: bool = True) -> requests.Session:
        """Returns a new request session instance.

        Parameters:
            bearer_token: whether to include bearer token

        Returns:
            class Session instance with Auth and bearer token headers
        """
        session = SessionWithHeaderRedirection()
        if bearer_token and self.token:
            # This will avoid the use of the netrc after we are logged in
            session.trust_env = False
            session.headers.update(
                {"Authorization": f"Bearer {self.token['access_token']}"}
            )
        return session
Returns a new request session instance.

        Parameters:
            bearer_token: whether to include bearer token

        Returns:
            class Session instance with Auth and bearer token headers
        
earthaccess/auth.py