def is_random_string_identifier(sid): """ could this have been generated by `random_string_identifier()`? :param sid: string identifier :type sid: string :returns: is the pattern a random string :rtype: bool """ sid_pattern = app.URLSAFE_CHAR * 12 return apf.full_match(sid_pattern, sid)
def is_random_string_identifier(sid): """ could this have been generated by `random_string_identifier()`? """ sid_pattern = app.URLSAFE_CHAR * 12 return apf.full_match(sid_pattern, sid)
def comment_line(zmat_str, symbol_pattern=SYMBOL_PATTERN): """ get the comment line (the header, if there is one) """ head_line = apf.strip_spaces(zmat_str.splitlines()[0]) return '' if apf.full_match(symbol_pattern, head_line) else head_line