def get_params(url, ignore_empty=False):
        """
        Static method that parses a given `url` and retrieves `url`'s parameters. Could also ignore empty value parameters.
        Handles parameters-only urls as `q=banana&peel=false`.

        :param str url: url to parse
        :param bool ignore_empty: ignore empty value parameter or not
        :return: dictionary of params and their values
        :rtype: dict
        """
        try:
            params_start_index = url.index('?')
        except ValueError:
            params_start_index = 0
        params_string = url[params_start_index + 1:]

        params_dict = {}
        for pair in params_string.split('&'):
            if not pair:
                continue
            splitted = pair.split('=')
            param, value = splitted
            if not value and ignore_empty:
                continue
            value = int(value) if value.isdigit() else value
            params_dict[param] = value
        return params_dict
def get_params ( url , ignore_empty = False ) : try : params_start_index = url . index ( '?' ) except ValueError : params_start_index = 0 params_string = url [ params_start_index + 1 : ] params_dict = { } for pair in params_string . split ( '&' ) : if not pair : continue splitted = pair . split ( '=' ) param , value = splitted if not value and ignore_empty : continue value = int ( value ) if value . isdigit ( ) else value params_dict [ param ] = value return params_dict
Static method that parses a given `url` and retrieves `url`'s parameters. Could also ignore empty value parameters.
        Handles parameters-only urls as `q=banana&peel=false`.

        :param str url: url to parse
        :param bool ignore_empty: ignore empty value parameter or not
        :return: dictionary of params and their values
        :rtype: dict