code: def check(package: str, version: str = "") -> bool:
      """
      Check whether the locally installed python package meets the conditions. If the package is not installed
      locally or the version number does not meet the conditions, return False, otherwise return True.
      """
      pdict = get_installed_packages()
      if not package in pdict:
          return False
      if not version:
          return True
      return pdict[package].match(version)
  
file_path: PaddleHub/paddlehub/utils/pypi.py
imports: import os
  import subprocess
  import sys
  from typing import IO
  from paddlehub.utils.utils import Version
  from paddlehub.utils.io import discard_oe
label_desc: Use image node_id 2 for calling a global function with example usage: check(package, version) and returns: pdict, False, True