input: Write a function to filter a list of email addresses and return a list containing only the email addresses that belong to a particular domain. The function should take two parameters: the list of email addresses and the domain to filter by. If the domain is an empty string, the function should return the original list.
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "gmail.com")==["john@gmail.com", "sophie@gmail.com"]
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "yahoo.com")==["sarah@yahoo.com"]
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "microsoft.com")==["bob@microsoft.com"]
  assert filter_emails(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "")==["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"]
  assert filter_emails([], "gmail.com")==[]
output: def filter_emails(emails, domain):
      if domain == "":
          return emails
      return [email for email in emails if email.endswith("@" + domain)]