Check if given string is a punctuation
353564
def is_punctuation(text):
    """"""
    return not (text.lower() in config.AVRO_VOWELS or
                text.lower() in config.AVRO_CONSONANTS)
639014
public static boolean isPunct(String s){
    Pattern p = Pattern.compile("^[\\p{Punct}]+$");
    Matcher m = p.matcher(s);
    return m.matches();
  }
1328325
private function punctuate(&$sentence)
    {
        $count = count($sentence);
        $sentence[$count - 1] = $sentence[$count - 1].'.';

        if ($count < 4) {
            return $sentence;
        }

        $commas = $this->numberOfCommas($count);

        for ($i = 1; $i <= $commas; ++$i) {
            $index = (int) round($i * $count / ($commas + 1));

            if ($index < ($count - 1) && $index > 0) {
                $sentence[$index] = $sentence[$index].',';
            }
        }

        return null;
    }
432621
static boolean isExpression(final String string) {
    if (string == null) {
      return false;
    }
    return string.startsWith("${") && string.endsWith("}");
  }
1279223
def is_ipa(s):
    """"""
    re_pattern = ('(?:%(syllable)s|[ \t%(punctuation)s])+' %
                  {'syllable': _IPA_SYLLABLE,
                   'punctuation': zhon.pinyin.punctuation})
    return _is_pattern_match(re_pattern, s)
1080907
def _is_punctuation(char):
    """"""
    cp = ord(char)
    # We treat all non-letter/number ASCII as punctuation.
    # Characters such as "^", "$", and "`" are not in the Unicode
    # Punctuation class but we treat them as punctuation anyways, for
    # consistency.
    if ((cp >= 33 and cp <= 47) or (cp >= 58 and cp <= 64) or
            (cp >= 91 and cp <= 96) or (cp >= 123 and cp <= 126)):
        return True
    cat = unicodedata.category(char)
    if cat.startswith("P"):
        return True
    return False
35014
def check_capitalized(self, function, docstring):
        
        if docstring:
            first_word = ast.literal_eval(docstring).split()[0]
            if first_word == first_word.upper():
                return
            for char in first_word:
                if char not in string.ascii_letters and char != "'":
                    return
            if first_word != first_word.capitalize():
                return violations.D403(first_word.capitalize(), first_word)
435962
def is_symbol(string):
    
    return (
        is_int(string) or is_float(string) or
        is_constant(string) or is_unary(string) or
        is_binary(string) or
        (string == '(') or (string == ')')
    )
767974
def is_str(arg):
    '''
     
    '''
    return (isinstance(arg, six.string_types) or
            is_npscalar(arg, 'string') or
            is_npvalue(arg, 'string'))
195097
def strip_punctuation(text, exclude='', include=''):
        """"""
        chars_to_strip = ''.join(
            set(list(punctuation)).union(set(list(include))) - set(list(exclude))
        )
        return text.strip(chars_to_strip)
1071795
function detectQuote(str) {
	if (str == null || str.length == 0) return false;
	var first = str.charAt(0);
	var last = str.charAt(str.length - 1);
	if (first != last) return false;
	if (first == map.single) return map.single;
	if (first == map.double) return map.double;
	return false;
}
380654
def strip_punctuation_space(value):
    ""
    def strip_punctuation(string):
        replacement_list = (
            (' .',  '.'),
            (' :',  ':'),
            ('( ',  '('),
            (' )',  ')'),
        )
        for match, replacement in replacement_list:
            string = string.replace(match, replacement)
        return string
    if value == None:
        return None
    if type(value) == list:
        return [strip_punctuation(v) for v in value]
    return strip_punctuation(value)
275203
function isCharJapanesePunctuation(char = '') {
  return JAPANESE_FULLWIDTH_PUNCTUATION_RANGES.some(([start, end]) => isCharInRange(char, start, end));
}
1006699
function isStringLiteralCode(s) {
    return (
        (s.startsWith("'") && s.endsWith("'")) ||
        (s.startsWith('"') && s.endsWith('"'))
    )
}
215536
static boolean isFollowedOrPrefixedByColon(String sql, int i) {
        return ':' == sql.charAt(i + 1) || (i > 0 && ':' == sql.charAt(i - 1));
    }
1316717
function _isQuote(c, escape, quote) {
        if (escape === "\\") {
            return false;
        }
        if (quote !== undefined) {
            return c === quote;
        }
        return c === "\"" || c === "'";
    }
1148552
def restore_punctuation(original,modified):
    '''  '''
    ret = ''
    count = 0
    try:
        for c in original:
            if c.isalpha(): 
                ret+=modified[count]
                count+=1
            else: ret+=c
    except IndexError:
        print('restore_punctuation: strings must have same number of alphabetic chars')
        raise
    return ret