<s> """<STR_LIT>""" <EOL> from synapse . api . urls import CLIENT_V2_ALPHA_PREFIX <EOL> import re <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> def client_v2_patterns ( path_regex , releases = ( <NUM_LIT:0> , ) ) : <EOL> """<STR_LIT>""" <EOL> patterns = [ re . compile ( "<STR_LIT>" + CLIENT_V2_ALPHA_PREFIX + path_regex ) ] <EOL> unstable_prefix = CLIENT_V2_ALPHA_PREFIX . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> patterns . append ( re . compile ( "<STR_LIT>" + unstable_prefix + path_regex ) ) <EOL> for release in releases : <EOL> new_prefix = CLIENT_V2_ALPHA_PREFIX . replace ( "<STR_LIT>" , "<STR_LIT>" % release ) <EOL> patterns . append ( re . compile ( "<STR_LIT>" + new_prefix + path_regex ) ) <EOL> return patterns </s>
