docstr: Borrowed from:
  https://stackoverflow.com/questions/19196105/how-to-check-if-a-network-port-is-open-on-linux
docstr_tok: ["Borrowed","from",":","https",":","\/\/stackoverflow.com\/questions\/19196105\/how-to-check-if-a-network-port-is-open-on-linux"]
code: def _local_port_available(self, port, rais=True):
      """
      Borrowed from:
      https://stackoverflow.com/questions/19196105/how-to-check-if-a-network-port-is-open-on-linux
      """
      try:
          backlog = 5
          sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          sock.bind(("127.0.0.1", port))
          sock.listen(backlog)
          sock.close()
          # sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
          # sock.bind(("::1", port))
          # sock.listen(backlog)
          # sock.close()
      except socket.error:  # pragma: no cover
          if rais:
              raise RuntimeError(
                  "The server is already running on port {0}".format(
                      port
                  )
              )
          else:
              return False
      return True
  
imports: from IPython import display
  import re
  import requests
  import threading
  import os
  from .None import _udash
  from gevent.pywsgi import WSGIServer
  from flask import Flask
  import socket
  import random
  from string import Template
  import logging
label_desc: Use image node_id 2 for calling the AppRunner obj's underlying member method code with example usage: obj._local_port_available(port, rais) and returns: True, False