input: Write a function to generate RSA public and private key pairs and save them in separate files named 'public.pem' and 'private.pem'. If the function completes without errors, it returns True; otherwise, it returns False.
  assert generate_key_pair() == True
  assert 'public.pem' in os.listdir()
  assert 'private.pem' in os.listdir()
  assert generate_key_pair() == True
  assert 'public.pem' in os.listdir()
  assert 'private.pem' in os.listdir()
output: from cryptography.hazmat.primitives.asymmetric import rsa
  from cryptography.hazmat.primitives import serialization
  
  def generate_key_pair():
      try:
          private_key = rsa.generate_private_key(
              public_exponent=65537,
              key_size=2048
          )
          public_key = private_key.public_key()
  
          with open("private.pem", "wb") as f:
              f.write(private_key.private_bytes(
                  encoding=serialization.Encoding.PEM,
                  format=serialization.PrivateFormat.PKCS8,
                  encryption_algorithm=serialization.NoEncryption()
              ))
  
          with open("public.pem", "wb") as f:
              f.write(public_key.public_bytes(
                  encoding=serialization.Encoding.PEM,
                  format=serialization.PublicFormat.SubjectPublicKeyInfo
              ))
          return True
      except Exception:
          return False