code: def hub_request(api, params, extra=None, timeout=8):
      params["hub_version"] = paddlehub.__version__.split("-")[0]
      params["paddle_version"] = paddle.__version__.split("-")[0]
  
      params["extra"] = json.dumps(extra)
      r = requests.get(api, params, timeout=timeout)
      return r.json()
  
imports: import json
  import os
  import requests
  import threading
  import time
  import yaml
  from collections import OrderedDict
  from typing import List
  import paddle
  import paddlehub
  import paddlehub.config
  from paddlehub.config import cache_config
  from paddlehub.server import ServerSource, GitSource
  from paddlehub.utils import utils
label_desc: Use image node_id 2 for calling a global function with example usage: hub_request(api, params, extra, timeout) and returns: r