input: Write a function to list the contents of a directory using Python. The function should return a list of all the files and directories within the specified directory. If no directory is specified, it should list the contents of the current directory.
  assert list_directory_contents() == sorted(os.listdir())
  assert list_directory_contents('/path/to/directory') == sorted(os.listdir('/path/to/directory'))
  assert list_directory_contents('/non/existent/path') == []
output: import os
  
  def list_directory_contents(directory=None):
      if directory is None:
          directory = os.getcwd()
      if not os.path.exists(directory):
          return []
      return os.listdir(directory)