def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True, force_search=False):
 urlstr = urlstr.strip()
 path = get_path_if_valid(urlstr, cwd=cwd, relative=relative, check_exists=True)
 if ((not force_search) and (path is not None)):
  url = QUrl.fromLocalFile(path)
 elif (force_search or (do_search and (not is_url(urlstr)))):
  log.url.debug('URL is a fuzzy search term')
  try:
   url = _get_search_url(urlstr)
  except ValueError:
   url = qurl_from_user_input(urlstr)
 else:
  log.url.debug('URL is a fuzzy address')
  url = qurl_from_user_input(urlstr)
 log.url.debug('Converting fuzzy term {!r} to URL -> {}'.format(urlstr, url.toDisplayString()))
 if (do_search and config.get('general', 'auto-search') and urlstr):
  qtutils.ensure_valid(url)
 elif (not url.isValid()):
  raise InvalidUrlError(url)
 return url

def fuzzy_url ( urlstr , cwd = None , relative = False , do_search = True , force_search = False ) : urlstr = urlstr . strip ( ) path = get_path_if_valid ( urlstr , cwd = cwd , relative = relative , check_exists = True ) if ( ( not force_search ) and ( path is not None ) ) : url = QUrl . fromLocalFile ( path ) elif ( force_search or ( do_search and ( not is_url ( urlstr ) ) ) ) : log . url . debug ( 'URL is a fuzzy search term' ) try : url = _get_search_url ( urlstr ) except ValueError : url = qurl_from_user_input ( urlstr ) else : log . url . debug ( 'URL is a fuzzy address' ) url = qurl_from_user_input ( urlstr ) log . url . debug ( 'Converting fuzzy term {!r} to URL -> {}' . format ( urlstr , url . toDisplayString ( ) ) ) if ( do_search and config . get ( 'general' , 'auto-search' ) and urlstr ) : qtutils . ensure_valid ( url ) elif ( not url . isValid ( ) ) : raise InvalidUrlError ( url ) return url
get a qurl based on a user input which is url or search term .