^[a-zA-Z][a-zA-Z0-9_-]*$
483374
@Override
    public String tagKey(String key) {
        String conventionKey = delegate.tagKey(key);

        conventionKey = START_UNDERSCORE_PATTERN.matcher(conventionKey).replaceAll(""); // 2
        conventionKey = SF_PATTERN.matcher(conventionKey).replaceAll(""); // 2

        if (!START_LETTERS_PATTERN.matcher(conventionKey).matches()) { // 3
            conventionKey = "a" + conventionKey;
        }
        return StringUtils.truncate(conventionKey, KEY_MAX_LENGTH); // 1
    }
842064
def _n(name):
    """"""
    n = name.encode('ascii', errors='ignore').decode('ascii')
    n = re.sub('[^A-Za-z0-9_]', '_', n)
    n = re.sub(r'(^[0-9].*)', r'p\1', n)
    return n
82793
function _nthchild($f, $c)
	{
		// $f is formula e.g. 2N+1 split into a preg_match array
		// $c is the comparator value e.g row or column number
		$c += 1;
		$select = false;

		$f_count = count($f);
		if ($f[0] === 'ODD') {
			$a = 2;
			$b = 1;
		} elseif ($f[0] === 'EVEN') {
			$a = 2;
			$b = 0;
		} elseif ($f_count === 2) {
			$a = 0;
			$b = $f[1] + 0;
		} // e.g. (+6)
		elseif ($f_count === 3) {  // e.g. (2N)
			if ($f[2] == '') {
				$a = 1;
			} elseif ($f[2] == '-') {
				$a = -1;
			} else {
				$a = $f[2] + 0;
			}
			$b = 0;
		} elseif ($f_count === 4) {  // e.g. (2N+6)
			if ($f[2] == '') {
				$a = 1;
			} elseif ($f[2] == '-') {
				$a = -1;
			} else {
				$a = $f[2] + 0;
			}
			$b = $f[3] + 0;
		} else {
			return false;
		}
		if ($a > 0) {
			if (((($c % $a) - $b) % $a) === 0 && $c >= $b) {
				$select = true;
			}
		} elseif ($a == 0) {
			if ($c == $b) {
				$select = true;
			}
		} else {  // if ($a<0)
			if (((($c % $a) - $b) % $a) === 0 && $c <= $b) {
				$select = true;
			}
		}
		return $select;
	}
373556
def slugify(cls, s):
        """"""
        slug = re.sub("[^0-9a-zA-Z-]", "-", s)
        return re.sub("-{2,}", "-", slug).strip('-')
620318
function () {
            var val = this.val;

            var a = val[ 0 ], b = val[ 1 ], c = val[ 2 ],
                d = val[ 3 ], e = val[ 4 ], f = val[ 5 ],
                g = val[ 6 ], h = val[ 7 ], i = val[ 8 ];

            var ta = i * e - f * h,
                td = f * g - i * d,
                tg = h * d - e * g;

            var n = a * ta + b * td + c * tg;

            val[ 0 ] = ta / n;
            val[ 1 ] = ( c * h - i * b ) / n;
            val[ 2 ] = ( f * b - c * e ) / n;

            val[ 3 ] = td / n;
            val[ 4 ] = ( i * a - c * g ) / n;
            val[ 5 ] = ( c * d - f * a ) / n;

            val[ 6 ] = tg / n;
            val[ 7 ] = ( b * g - h * a ) / n;
            val[ 8 ] = ( e * a - b * d ) / n;

            return this;
        }
96155
function bnpToRadix(b) {
    if (b == null) b = 10;
    if (this.signum() === 0 || b < 2 || b > 36) return "0";
    var cs = this.chunkSize(b);
    var a = Math.pow(b, cs);
    var d = nbv(a), y = nbi(), z = nbi(), r = "";
    this.divRemTo(d, y, z);
    while (y.signum() > 0) {
        r = (a + z.intValue()).toString(b).substr(1) + r;
        y.divRemTo(d, y, z);
    }
    return z.intValue().toString(b) + r;
}
1344739
def sam_verifier(entries, line=None):
    

    regex = r'^[!-?A-~]{1,255}\t' \
            + r'([0-9]{1,4}|[0-5][0-9]{4}|' \
            + r'[0-9]{1,4}|[1-5][0-9]{4}|' \
            + r'6[0-4][0-9]{3}|65[0-4][0-9]{2}|' \
            + r'655[0-2][0-9]|6553[0-7])\t' \
            + r'\*|[!-()+-<>-~][!-~]*\t' \
            + r'([0-9]{1,9}|1[0-9]{9}|2(0[0-9]{8}|' \
            + r'1([0-3][0-9]{7}|4([0-6][0-9]{6}|' \
            + r'7([0-3][0-9]{5}|4([0-7][0-9]{4}|' \
            + r'8([0-2][0-9]{3}|3([0-5][0-9]{2}|' \
            + r'6([0-3][0-9]|4[0-7])))))))))\t' \
            + r'([0-9]{1,2}|1[0-9]{2}|' \
            + r'2[0-4][0-9]|25[0-5])\t' \
            + r'\*|([0-9]+[MIDNSHPX=])+\t' \
            + r'\*|=|[!-()+-<>-~][!-~]*\t' \
            + r'([0-9]{1,9}|1[0-9]{9}|2(0[0-9]{8}|' \
            + r'1([0-3][0-9]{7}|4([0-6][0-9]{6}|' \
            + r'7([0-3][0-9]{5}|4([0-7][0-9]{4}|' \
            + r'8([0-2][0-9]{3}|3([0-5][0-9]{2}|' \
            + r'6([0-3][0-9]|4[0-7])))))))))\t' \
            + r'-?([0-9]{1,9}|1[0-9]{9}|2(0[0-9]{8}|' \
            + r'1([0-3][0-9]{7}|4([0-6][0-9]{6}|' \
            + r'7([0-3][0-9]{5}|4([0-7][0-9]{4}|' \
            + r'8([0-2][0-9]{3}|3([0-5][0-9]{2}|' \
            + r'6([0-3][0-9]|4[0-7])))))))))\t' \
            + r'\*|[A-Za-z=.]+\t' \
            + r'[!-~]+{0}$'.format(os.linesep)
    delimiter = r'\t'

    for entry in entries:
        try:
            entry_verifier([entry.write()], regex, delimiter)
        except FormatError as error:
            # Format info on what entry error came from
            if line:
                intro = 'Line {0}'.format(str(line))
            elif error.part == 0:
                intro = 'An entry with reference {0}'.format(entry.rname)
            else:
                intro = 'An entry with query {0}'.format(entry.qname)

            # Generate error
            if error.part == 0:
                if len(entry.qname) == 0:
                    msg = '{0} has no query name'.format(intro)
                elif len(entry.qname) > 255:
                    msg = '{0} query name must be less than 255 ' \
                          'characters'.format(intro)
                else:
                    msg = '{0} query name contains characters not in ' \
                          '[!-?A-~]'.format(intro)
            elif error.part == 1:
                msg = '{0} flag not in range [0-(2^31-1)]'.format(intro)
            elif error.part == 2:
                if len(entry.rname) == 0:
                    msg = '{0} has no reference name'.format(intro)
                else:
                    msg = '{0} reference name has characters not in ' \
                          '[!-()+-<>-~][!-~]'.format(intro)
            elif error.part == 3:
                msg = '{0} leftmost position not in range ' \
                      '[0-(2^31-1)]'.format(intro)
            elif error.part == 4:
                msg = '{0} mapping quality not in range ' \
                      '[0-(2^8-1)]'.format(intro)
            elif error.part == 5:
                msg = '{0} CIGAR string has characters not in ' \
                      '[0-9MIDNSHPX=]'.format(intro)
            elif error.part == 6:
                msg = '{0} mate read name has characters not in ' \
                      '[!-()+-<>-~][!-~]'.format(intro)
            elif error.part == 7:
                msg = '{0} mate read position not in range ' \
                      '[0-(2^31-1)]'.format(intro)
            elif error.part == 8:
                msg = '{0} template length not in range ' \
                      '[(-2^31+1)-(2^31-1)]'.format(intro)
            elif error.part == 9:
                msg = '{0} sequence has characters not in ' \
                      '[A-Za-z=.]'.format(intro)
            elif error.part == 10:
                msg = '{0} quality scores has characters not in ' \
                      '[!-~]'.format(intro)
            else:
                msg = '{0}: Unknown Error: Likely a Bug'.format(intro)
            raise FormatError(message=msg)

        if line:
            line += 1
1084665
def case_us2mc(x):
    
    return re.sub(r'_([a-z])', lambda m: (m.group(1).upper()), x)
911836
def LL(n):
    """"""
    if (n<=0):return Context('0')
    else:
        LL1=LL(n-1)
        r1 = C1(3**(n-1),2**(n-1)) - LL1 - LL1
        r2 = LL1 - LL1 - LL1
        return r1 + r2
462175
function sk(key) {
    if (globalKeySanitize) {
      return key;
    } else {
      return key.replace(/\s+/g, '_')
                .replace(/\//g, '-')
                .replace(/[^a-zA-Z_\-0-9\.]/g, '');
    }
  }
924221
function(param_, test) {
  var param = param_.replace(/\s+/g, '')
    , cap;

  if (param === 'even') {
    param = '2n+0';
  } else if (param === 'odd') {
    param = '2n+1';
  } else if (param.indexOf('n') === -1) {
    param = '0n' + param;
  }

  cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param);

  return {
    group: cap[1] === '-'
      ? -(cap[2] || 1)
      : +(cap[2] || 1),
    offset: cap[4]
      ? (cap[3] === '-' ? -cap[4] : +cap[4])
      : 0
  };
}
991777
function ( text ){
		   var out = [text],
			   chars = ['-','+','z','Z'],
			   i = chars.length;

			while (i--) {
			  if(text.indexOf(chars[i]) > -1){
				  out[0] = text.slice( 0, text.indexOf(chars[i]) );
				  out.push( text.slice( text.indexOf(chars[i]) ) );
				  break;
			   }
			}
		   return out;
		}
332987
function step1b(token) {
    var r1 = getR1(token);

    if (!r1) {
        return token;
    }

    if (token.match(/(b|c|d|f|g|h|j|l|m|n|o|p|r|t|v|y|z)s$/)) {
        return token.slice(0, -1);
    }

    if (token.match(/([^aeiouyæåø]k)s$/)) {
        return token.slice(0, -1);
    }

    return token;
}
277016
function(n) {
            n = parseInt(n,10)|0;
            n = (n > 255 || n < 0) ? 0 : n;

            return (ZERO+n.toString(16)).slice(-2).toUpperCase();
        }
588531
def _filter(self):
        
        pattern = u"[\s+\.\!\-\/_,$%^*(+\"\']+|[+——！】【，。？?:、：~@#￥%……&*“”（）]+"
        self.m = re.sub(pattern, "", self.m)
495311
function underscore(str) {
        return str.replace(/[-\s]+/g, '_').replace(/([A-Z\d]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase();
    }
889638
function unit(input){
  var word = S(input).stripPunctuation().s.toLowerCase().trim();
  if(!word){ return 0; }
  if(word.length <= 3) { return 1; }
  word = word.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '');
  word = word.replace(/^y/, '');
  var syllbs = word.match(/[aeiouy]{1,2}/g);
  return (syllbs ? syllbs.length : 0);
}