code: def get_node_ip():
      """
      This function is ported from ray to get the ip of the current node. In the settings where
      Ray is not involved, calling ray._private.services.get_node_ip_address would introduce
      Ray overhead.
      """
      import socket
      import errno
  
      s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      try:
          # This command will throw an exception if there is no internet connection.
          s.connect(("8.8.8.8", 80))
          node_ip_address = s.getsockname()[0]
      except OSError as e:
          node_ip_address = "127.0.0.1"
          # [Errno 101] Network is unreachable
          if e.errno == errno.ENETUNREACH:
              try:
                  # try get node ip address from host name
                  host_name = socket.getfqdn(socket.gethostname())
                  node_ip_address = socket.gethostbyname(host_name)
              except Exception:
                  pass
      finally:
          s.close()
      return node_ip_address
  
imports: import glob
  from bigdl.dllib.utils.file_utils import Sample
  import numpy
  from pyspark.ml.linalg import DenseVector, SparseVector, VectorUDT
  import sys
  import os
  import re
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 2 for calling a global function with example usage: get_node_ip() and returns: node_ip_address