<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_session():
 """Build the session object."""

    # NOTE(msimonin): We provide only a basic support which focus
    # Chameleon cloud and its rc files
    if os.environ.get("OS_IDENTITY_API_VERSION") == "3":
        logging.info("Creating a v3 Keystone Session")
        auth = v3.Password(
            auth_url=os.environ["OS_AUTH_URL"],
            username=os.environ["OS_USERNAME"],
            password=os.environ["OS_PASSWORD"],
            project_id=os.environ["OS_PROJECT_ID"],
            user_domain_name=os.environ["OS_USER_DOMAIN_NAME"]
        )

    else:
        logging.info("Creating a v2 Keystone Session")
        auth = v2.Password(
            auth_url=os.environ["OS_AUTH_URL"],
            username=os.environ["OS_USERNAME"],
            password=os.environ["OS_PASSWORD"],
            tenant_id=os.environ["OS_TENANT_ID"])

    return session.Session(auth=auth)