input: Write a function to list the contents of a given directory. The function should return a list of filenames and directories within the specified directory. If the directory does not exist, the function should return an empty list.
  
  
  def list_directory_contents(directory):
      import os
      if not os.path.exists(directory):
          return []
      return os.listdir(directory)
  
  assert list_directory_contents('/home/user/documents') == ['file1.txt', 'file2.txt', 'subdir']
  assert list_directory_contents('/non/existent/path') == []
  assert list_directory_contents('.') == os.listdir('.')
  
output: def list_directory_contents(directory):
      import os
      if not os.path.exists(directory):
          return []
      return os.listdir(directory)