Return a float for sentiment strength based on the input text.
        Positive values are positive valence, negative value are negative
        valence.
480613
def polarity_scores(self, text):
        
        # convert emojis to their textual descriptions
        text_token_list = text.split()
        text_no_emoji_lst = []
        for token in text_token_list:
            if token in self.emojis:
                # get the textual description
                description = self.emojis[token]
                text_no_emoji_lst.append(description)
            else:
                text_no_emoji_lst.append(token)
        text = " ".join(x for x in text_no_emoji_lst)

        sentitext = SentiText(text)

        sentiments = []
        words_and_emoticons = sentitext.words_and_emoticons
        for item in words_and_emoticons:
            valence = 0
            i = words_and_emoticons.index(item)
            # check for vader_lexicon words that may be used as modifiers or negations
            if item.lower() in BOOSTER_DICT:
                sentiments.append(valence)
                continue
            if (i < len(words_and_emoticons) - 1 and item.lower() == "kind" and
                    words_and_emoticons[i + 1].lower() == "of"):
                sentiments.append(valence)
                continue

            sentiments = self.sentiment_valence(valence, sentitext, item, i, sentiments)

        sentiments = self._but_check(words_and_emoticons, sentiments)

        valence_dict = self.score_valence(sentiments, text)

        return valence_dict
513229
def _value_from_label(self, label):
        '''
        '''
        unser_val = (label.rel_strength.value, label.meta)
        return cbor.dumps(unser_val)
960614
def classify(self, text):
        
        score = self.score(text)
        if not score:
            return None
        return sorted(score.items(), key=lambda v: v[1])[-1][0]
501560
public float getTextRise() {
		if (attributes != null && attributes.containsKey(SUBSUPSCRIPT)) {
			Float f = (Float) attributes.get(SUBSUPSCRIPT);
			return f.floatValue();
		}
		return 0.0f;
	}
225576
def positive_int(value: str) -> int:
    
    try:
        ivalue = int(value)
        assert ivalue > 0
    except (AssertionError, TypeError, ValueError):
        raise ArgumentTypeError(
            "{!r} is an invalid positive int".format(value))
    return ivalue
21157
def percentOfTotal(self, value, values):
        
        try:
            return float(value) / sum(values)
        except (ZeroDivisionError, TypeError, ValueError):
            return 0.0
465389
def check_positive(value, strict=False):
    
    if not strict and value < 0:
        raise ValueError("Value must be positive or zero, not %s" % str(value))
    if strict and value <= 0:
        raise ValueError("Value must be positive, not %s" % str(value))
100045
def __float(value):
    ''''''
    valid, _value = False, value
    try:
        _value = float(value)
        valid = True
    except ValueError:
        pass
    return (valid, _value, 'float')
1049790
def parse_float(float_str):
    """"""
    factor = __get_factor(float_str)
    if factor != 1:
        float_str = float_str[:-1]

    try:
        return float(float_str.replace(',', '')) * factor
    except ValueError:
        return None
1318938
def sentiment(self):
        
        if self._sentiment is None:
            self._sentiment = int(self._element.get('sentiment'))
        return self._sentiment
3146
def get_float(strings: Sequence[str],
              prefix: str,
              ignoreleadingcolon: bool = False,
              precedingline: str = "") -> Optional[float]:
    
    return get_float_raw(get_string(strings, prefix,
                                    ignoreleadingcolon=ignoreleadingcolon,
                                    precedingline=precedingline))
215307
def get_p_vals(df, positive_category, term_significance):
	'''
	
	'''
	df_pos = df[[positive_category]]
	df_pos.columns = ['pos']
	df_neg = pd.DataFrame(df[[c for c in df.columns if
	                          c != positive_category
	                          and c.endswith(' freq')]].sum(axis=1))
	df_neg.columns = ['neg']
	X = df_pos.join(df_neg)[['pos','neg']].values
	return term_significance.get_p_vals(X)
230685
def value(self, term, **kwargs):
        
        term = self._normalize(term)
        if term in self._values:
            return self._values[term]
        for classifier in self.classifiers:
            v = classifier.value(term, **kwargs)
            if v is not None:
                return v
1195239
def strictly_positive_int_or_none(val):
    """"""
    val = positive_int_or_none(val)
    if val is None or val > 0:
        return val
    raise ValueError('"{}" must be strictly positive'.format(val))
1317692
def parse_value(val, parsebool=False):
    
    try:
        return int(val)
    except ValueError:
        pass
    try:
        return float(val)
    except:
        pass
    if parsebool:
        if re.match('yes|on', str(val), re.IGNORECASE):
            return True
        elif re.match('no|off', str(val), re.IGNORECASE):
            return False
    return val
45030
def percentOfTotal(self, value, values):
        
        try:
            return float(values.index(value) + 1) / len(values)
        except (ZeroDivisionError, ValueError):
            return 0.0
1201962
def _min_max_filter(t: List, min_v: str, max_v: str) -> bool:
        

        def tofloat(value):
            try:
                float(value)
                return float(value)
            except ValueError:
                return False

        for a_token in t:
            if not tofloat(a_token.text):
                return False
            else:
                if min_v and tofloat(min_v):
                    this_v = tofloat(a_token.text)
                    if this_v < tofloat(min_v):
                        return False
                if max_v and tofloat(max_v):
                    this_v = tofloat(a_token.text)
                    if this_v > tofloat(max_v):
                        return False

        return True