input: Write a function to encrypt a message using a Caesar cipher. The function should take the message and a shift amount as input, and return the encrypted message. It should handle characters beyond the printable ASCII range by wrapping around. If the message or shift is empty, return the original message.
  assert caesar_encrypt("Hello, World!", 3) == "Khoor/#Zruog$"
  assert caesar_encrypt("ABCdef", 1) == "BCDefg"
  assert caesar_encrypt("", 5) == ""
  assert caesar_encrypt("123", 0) == "123"
  assert caesar_encrypt("XYZ", 100) == "RPH"
output: def caesar_encrypt(message, shift):
      if not message or not shift:
          return message
      encrypted_message = []
      for char in message:
          if char.isalpha():
              shift_amount = shift % 26
              if char.islower():
                  new_char = chr((ord(char) - ord('a') + shift_amount) % 26 + ord('a'))
              else:
                  new_char = chr((ord(char) - ord('A') + shift_amount) % 26 + ord('A'))
          else:
              new_char = chr((ord(char) + shift) % 128)
          encrypted_message.append(new_char)
      return ''.join(encrypted_message)