Masks a phone number, only first 3 and last 2 digits visible.

    Examples:

    * `+31 * ******58`

    :param number: str or phonenumber object
    :return: str
972040
def mask_phone_number(number):
    
    if isinstance(number, phonenumbers.PhoneNumber):
        number = format_phone_number(number)
    return phone_mask.sub('*', number)
671159
def read_digits(ctx, text):
    
    def chunk(value, chunk_size):
        return [value[i: i + chunk_size] for i in range(0, len(value), chunk_size)]

    text = conversions.to_string(text, ctx).strip()
    if not text:
        return ''

    # trim off the plus for phone numbers
    if text[0] == '+':
        text = text[1:]

    length = len(text)

    # ssn
    if length == 9:
        result = ' '.join(text[:3])
        result += ' , ' + ' '.join(text[3:5])
        result += ' , ' + ' '.join(text[5:])
        return result

    # triplets, most international phone numbers
    if length % 3 == 0 and length > 3:
        chunks = chunk(text, 3)
        return ' '.join(','.join(chunks))

    # quads, credit cards
    if length % 4 == 0:
        chunks = chunk(text, 4)
        return ' '.join(','.join(chunks))

    # otherwise, just put a comma between each number
    return ','.join(text)
517027
function numToDigits(num) {
	var digits = num.toString().split('');
	for (var i = 0; i < digits.length; i++) {
		digits[i] = +digits[i];
	}
	digits.reverse();
	return digits;
}
351942
Rule XcomNumber() {
		return Sequence(OneOrMore(DIGIT()),
						Optional(Sequence('.', OneOrMore(DIGIT())))
		).label(XcomNumber).suppressSubnodes();
	}
95041
private void scanNumber() {

        if (mInput >= '0' && mInput <= '9') {
            mOutput.append(mInput);
            mPos++;
        } else {
            // could be an e-number
            if (mInput == 'E' || mInput == 'e') {
                mStartState = State.E_NUM;
            }
            mFinnished = true;
        }
    }
671246
def posnegtoggle(number):
    
    if bool(number > 0):
        return number - number * 2
    elif bool(number < 0):
        return number + abs(number) * 2
    elif bool(number == 0):
        return number
831198
def one_mask(self):
        """"""
        accum = 0
        for i in range(self.data.itemsize):
            accum += (0xAA << (i << 3))
        return accum
851199
def from_text(text):
        
        number = int(filter(unicode.isdigit, unicode(text)))
        return Phone(number=number)
1006688
def selectNumber(self):
        
        le = self.lineEdit()
        text = asUnicode(le.text())
        if self.opts['suffix'] == '':
            le.setSelection(0, len(text))
        else:
            try:
                index = text.index(' ')
            except ValueError:
                return
            le.setSelection(0, index)
169716
function(number) {
    var layers = {}
    var c = 0;
    for(var i = 0; i < this.layers.length; ++i) {
      var layer = this.layers[i];
      layers[i] = c;
      if(layer.options && !layer.options.hidden) {
        ++c;
      }
    }
    return layers[number];
  }
956789
def prefixlen_to_mask(prefixlen):
    
    prefixlen = prefixlen or '32'
    addr = '0.0.0.0/%s' % prefixlen
    return str(netaddr.IPNetwork(addr).netmask)
179631
def two_digit_number(number, combined = false)
      words = combined ? simple_number_to_words_combined(number) : simple_number_to_words(number)
      return words if(words != 'not_found')
      
      rest = number % 10
      format = "spell_number.formats.tens.#{rest == 0 ? 'no_rest' : 'rest'}"
      first_digit = simple_number_to_words(number - rest)
      second_digit = simple_number_to_words_combined(rest)
      I18n.t(format, :locale => @options[:locale], :first_digit => first_digit, :second_digit => second_digit)
    end
1224794
def ensure_number(num, *args, **kwargs):
    
    return num if isinstance(num, Number) else Number(num, *args, **kwargs)
1203479
def format_(num, n=8):
    
    if num is None:
        return 'None'
    if util_type.is_float(num):
        ret = ('%.' + str(n) + 'E') % num
        exp_pos  = ret.find('E')
        exp_part = ret[(exp_pos + 1):]
        exp_part = exp_part.replace('+', '')
        if exp_part.find('-') == 0:
            exp_part = '-' + exp_part[1:].strip('0')
        exp_part = exp_part.strip('0')
        if len(exp_part) > 0:
            exp_part = 'E' + exp_part
        flt_part = ret[:exp_pos].strip('0').strip('.')
        ret = flt_part + exp_part
        return ret
    return '%d' % num
993032
def GetName(self, number):
    
    value = self._data_type_definition.values_per_number.get(number, None)
    if not value:
      return None

    return value.name
1292331
def local_regon(self):
        
        regon_digits = [int(digit) for digit in list(self.regon())]

        for _ in range(4):
            regon_digits.append(self.random_digit())

        regon_digits.append(local_regon_checksum(regon_digits))

        return ''.join(str(digit) for digit in regon_digits)
631393
Rule NthRepeatNum() {
		return Sequence(
			DIGITS(),
			ZeroOrMoreS(SequenceS(FirstOf(',', '-').suppressNode(),
								DIGITS()))
		).label(NthRepeatNum);
	}