input: Write a python function to list all installed packages with their versions using pip.
  assert 'pip' in [pkg.split('==')[0] for pkg in pip_list()]
  assert isinstance(pip_list(), list)
  assert all('==' in pkg for pkg in pip_list())
output: def pip_list():
      import subprocess
      result = subprocess.run(['pip', 'list', '--format=freeze'], stdout=subprocess.PIPE, text=True)
      return result.stdout.splitlines()