original_docstring: Verify that docker is installed and the user has permission to
      run docker images.
  
      Returns
      -------
      -1  Docker can't be found
       0  Docker found, but user can't connect to daemon
       1  Test run OK
       
docstring: Verify that docker is installed and the user has permission to
  run docker images.
  
  Returns
  
  1  Docker can't be found
  0  Docker found, but user can't connect to daemon
  1  Test run OK
docstring_tokens: Verify that docker is installed and the user has permission to run docker images . Returns 1 Docker can ' t be found 0 Docker found but user can ' t connect to daemon 1 Test run OK
code: def check_docker():
      """Verify that docker is installed and the user has permission to
      run docker images.
  
      Returns
      -------
      -1  Docker can't be found
       0  Docker found, but user can't connect to daemon
       1  Test run OK
       """
      try:
          ret = subprocess.run(['docker', 'version'], stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE)
      except OSError as e:
          from errno import ENOENT
          if e.errno == ENOENT:
              return -1
          raise e
      if ret.stderr.startswith(b"Cannot connect to the Docker daemon."):
          return 0
      return 1
code_tokens: def check_docker ( ) : try : ret = subprocess . run ( [ 'docker' , 'version' ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) except OSError as e : from errno import ENOENT if e . errno == ENOENT : return - 1 raise e if ret . stderr . startswith ( b"Cannot connect to the Docker daemon." ) : return 0 return 1
short_docstring: Verify that docker is installed and the user has permission to
  run docker images.
short_docstring_tokens: Verify that docker is installed and the user has permission to run docker images .
comment: """Verify that docker is installed and the user has permission to
      run docker images.
  
      Returns
      -------
      -1  Docker can't be found
       0  Docker found, but user can't connect to daemon
       1  Test run OK
       """