def strip_punc(s, all=False):
 if all:
  return PUNCTUATION_REGEX.sub('', s.strip())
 else:
  return s.strip().strip(string.punctuation)

def strip_punc ( s , all = False ) : if all : return PUNCTUATION_REGEX . sub ( '' , s . strip ( ) ) else : return s . strip ( ) . strip ( string . punctuation )
removes punctuation from a string .