code: def getCredentials(self):
          
  
          (username, password, public_key, private_key) = self.getCredentialValues()
  
          if public_key or private_key:
              return UserKeyCredential(username, public_key, private_key)
  
          if username or password:
              return UserPassCredential(username, password)
  
          return None
docs: Return UserKeyCredential or UserPassCredential.