code: def is_container_running():
      """Check whether the elasticsearch container is up and running
      with the correct port being exposed.
      """
  
      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      status = sock.connect_ex(("127.0.0.1", 27017))
      if status == 0:
          return True
      else:
          return False
  
file_path: io/tests/test_mongodb.py
imports: import socket
  import pytest
  import tensorflow
  from tensorflow import feature_column
  from tensorflow.keras import layers
  import tensorflow_io
label_desc: Use image node_id 1 for calling a global function with example usage: is_container_running() and returns: True, False