def METHOD_NAME(session, change_dir):
    """Ensure the direct_REST_calls.py example executes successfully."""
    from pickle import UnpicklingError
    # Mock up Session() to return the Betamax-recorded session
    def Session(*args, **kwargs):
        return session
    change_dir("examples")
    with open("direct_REST_calls.py") as f:
        # Remove import of Session to ensure mock function will be used
        # instead.
        code = f.read().replace(
            "from sasctl import get, get_link, request_link, Session",
            "from sasctl import get, get_link, request_link",
        )
        try:
            exec(code)
        except (UnpicklingError, KeyError) as e:
            if "'\xef'" in str(e):
                # Betamax recording adds additional bytes to the content which
                # breaks unpickling.  Ignore when this happens as correct
                # handling of binary contents should be validated in integration
                # tests
                pass