code: def get_local_aws_session():
      
      if not all((app_config.aws_api.access_key, app_config.aws_api.secret_key)):
          return boto3.session.Session()
      else:
          # If we are not running on an EC2 instance, assume the instance role
          # first, then assume the remote role
          session_args = [app_config.aws_api.access_key, app_config.aws_api.secret_key]
          if app_config.aws_api.session_token:
              session_args.append(app_config.aws_api.session_token)
  
          return boto3.session.Session(*session_args)
docs: Returns a session for the local instance, not for a remote account
  
      Returns:
          :obj:`boto3:boto3.session.Session`