docstr: Stop PaddleHub-Serving by port.
docstr_tok: ["Stop","PaddleHub-Serving","by","port","."]
code: def stop_serving(self, port: int):
      """
      Stop PaddleHub-Serving by port.
      """
      filepath = os.path.join(
          CONF_HOME, "serving_" + str(port) + ".json"
      )
      info = self.load_pid_file(filepath, port)
      if info is False:
          return
      pid = info["pid"]
      module = info["module"]
      start_time = info["start_time"]
      CacheUpdater(
          "hub_serving_stop",
          module=module,
          addition={"period_time": time.time() - start_time},
      ).start()
      if os.path.exists(filepath):
          os.remove(filepath)
  
      if not pid_is_exist(pid):
          log.logger.info("PaddleHub Serving has been stopped.")
          return
      log.logger.info("PaddleHub Serving will stop.")
      if platform.system() == "Windows":
          os.kill(pid, signal.SIGTERM)
      else:
          try:
              os.killpg(pid, signal.SIGTERM)
          except ProcessLookupError:
              os.kill(pid, signal.SIGTERM)
  
imports: import argparse
  import os
  import platform
  import json
  import multiprocessing
  import time
  import signal
  import paddlehub
  from paddlehub.commands import register
  from paddlehub.serving import app_compat
  from paddlehub.env import CONF_HOME
  from paddlehub.serving.http_server import run_all, StandaloneApplication
  from paddlehub.utils import log
  from paddlehub.utils.utils import is_port_occupied
  from paddlehub.server.server import CacheUpdater
label_desc: Use image node_id 3 for calling the ServingCommand obj's underlying member method code with example usage: obj.stop_serving(port) without return types