code: def bind_unused_port(reuse_port=False):
      """Binds a server socket to an available port on localhost.
  
      Returns a tuple (socket, port).
  
      .. versionchanged:: 4.4
         Always binds to ``127.0.0.1`` without resolving the name
         ``localhost``.
      """
      sock = netutil.bind_sockets(
          None,
          "127.0.0.1",
          family=socket.AF_INET,
          reuse_port=reuse_port,
      )[0]
      port = sock.getsockname()[1]
      return sock, port
  
imports: from __future__ import absolute_import, division, print_function
  from tornado.log import gen_log, app_log
  from tornado.stack_context import ExceptionStackContext
  from tornado.util import raise_exc_info, basestring_type, PY3
  import functools
  import inspect
  import logging
  import os
  import re
  import signal
  import socket
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: bind_unused_port(reuse_port) and returns: sock,  port