code: def check_imported(module):
          
          imported = True
          module_info = ('', '', '')
          # TODO: if possible, update to a cleaner method that doesn't require importing the module
          # and running inline code.
          try:
              importlib.import_module(module)
              module_info = imp.find_module(module)
          except ImportError:
              imported = False
  
          # get module path
          module_path = module_info[1]
          description = module_info[2]
  
          if not description:
              # if description is None or empty string the module could not be imported
              imported = False
          elif not description and not module_path:
              # if description/module_path are None or empty string the module could not be imported
              imported = False
          elif module_path is not None and (
              'dist-packages' in module_path or 'site-packages' in module_path
          ):
              # if dist-packages|site-packages in module_path the import doesn't count
              imported = False
          return imported
docs: Check whether the provide module can be imported (package installed).
  
          Args:
              module (str): The name of the module to check availability.
  
          Returns:
              bool: True if the module can be imported, False otherwise.