code: def test_ls(self):
      # check project is not initialized if wrong home
      Config().set_home(os.path.join("does", "not", "exist"))
      failed = False
      try:
          ls()
      except InvalidProjectPath:
          failed = True
      assert failed
  
      # Reset to the correct home dir
      Config().set_home(self.temp_dir)
  
      # create with default params and files to commit
      test_filepath = os.path.join(self.temp_dir, "script.py")
      with open(test_filepath, "wb") as f:
          f.write(to_bytes("import numpy\n"))
          f.write(to_bytes("import sklearn\n"))
  
      create(message="test1")
  
      # list all snapshots with no filters
      snapshot_list_1 = ls()
  
      assert snapshot_list_1
      assert len(list(snapshot_list_1)) == 1
      assert isinstance(snapshot_list_1[0], Snapshot)
  
      # Create a snapshot with default params, files, and environment
      test_filepath = os.path.join(self.temp_dir, "Dockerfile")
      with open(test_filepath, "wb") as f:
          f.write(to_bytes("FROM python:3.5-alpine"))
      create(message="test2")
  
      # list all snapshots with no filters (works when more than 1 snapshot)
      snapshot_list_2 = ls()
  
      assert snapshot_list_2
      assert len(list(snapshot_list_2)) == 2
      assert isinstance(snapshot_list_2[0], Snapshot)
      assert isinstance(snapshot_list_2[1], Snapshot)
  
      # list snapshots with specific filter
      snapshot_list_3 = ls(filter="test2")
  
      assert snapshot_list_3
      assert len(list(snapshot_list_3)) == 1
      assert isinstance(snapshot_list_3[0], Snapshot)
  
      # list snapshots with filter of none
      snapshot_list_4 = ls(filter="test3")
  
      assert len(list(snapshot_list_4)) == 0
  
imports: import os
  import tempfile
  import platform
  from io import open, TextIOWrapper
  from datmo.snapshot import create, ls, update, delete
  from datmo.config import Config
  from datmo.snapshot import Snapshot
  from datmo.core.entity.snapshot import Snapshot
  from datmo.core.controller.project import ProjectController
  from datmo.core.controller.task import TaskController
  from datmo.core.util.exceptions import InvalidProjectPath, SnapshotCreateFromTaskArgs, EntityNotFound, DoesNotExist
  from datmo.core.util.misc_functions import pytest_docker_environment_failed_instantiation
label_desc: Use image node_id 7 for calling the TestSnapshotModule obj's underlying member method code with example usage: obj.test_ls() without return types