36+ results for 're.compile lang:python' (0 ms)

Not the results you expected?

cmd_line.py (https://bitbucket.org/rafaelmoreira/sublime-text.git) Python · 340 lines

144 offsets = []

145 sign = 1

146 is_num_or_sign = re.compile('^[0-9+-]')

147 while self.c != EOF and is_num_or_sign.match(self.c):

148 if self.c in '+-':

176 def consume_while_match(self, regex):

177 rv = ''

178 r = re.compile(regex)

179 while self.c != EOF and r.match(self.c):

180 rv += self.c

298 offsets = []

299 sign = 1

300 is_num_or_sign = re.compile('^[0-9+-]')

301 while self.c != EOF and is_num_or_sign.match(self.c):

302 if self.c in '+-':

utils.py (https://github.com/9h37/delikatess.git) Python · 221 lines

87 self.dest = dest

88

89 self.pattern = re.compile (r"(\.\d+)*.gpg")

90

91 def _backup (self, path, iterate = 1):

sgml.py (https://github.com/sabren/scrapy.git) Python · 158 lines

88 return True

89

90 _re_type = type(re.compile("", 0))

91

92 _matches = lambda url, regexs: any((r.search(url) for r in regexs))

98 tags=('a', 'area'), attrs=('href'), canonicalize=True, unique=True, process_value=None,

99 deny_extensions=None):

100 self.allow_res = [x if isinstance(x, _re_type) else re.compile(x) for x in arg_to_iter(allow)]

101 self.deny_res = [x if isinstance(x, _re_type) else re.compile(x) for x in arg_to_iter(deny)]

prettifiers.py (https://github.com/vis-netlausnir/visutils.git) Python · 308 lines

211 return tree

212

213 _non_id_char = re.compile('[^_0-9a-zA-Z]')

214 class _SafeObject(object):

215 def __init__(self):

buildinator_common.py (https://github.com/vasi/kdelibs.git) Python · 152 lines

138 """Make an BuildStatus list of revisions, sorted latest-to-older"""

139 Lines = GetSvnLog ( SvnUrl )

140 RevisionLine = re.compile( '^r\d+\s')

141 Revisions = []

142 for Line in Lines:

load_phonon.py (https://github.com/wdzhou/mantid.git) Python · 185 lines

21

22 # Get regex strings from load_helper

23 header_regex = re.compile(load_helper.PHONON_HEADER_REGEX)

24 eigenvectors_regex = re.compile(load_helper.PHONON_EIGENVEC_REGEX)

transformations.py (https://gitlab.com/oytunistrator/snowscript) Python · 353 lines

342 return token_stream

343

344 _newline_pattern = re.compile(r"\n")

345

346

DownloadData.py (https://github.com/JasonAng/ResearchScripts.git) Python · 150 lines

18 "DownloadData object"

19

20 chromosomePat = re.compile('\$c\$')

21 ESTsuffixPat = re.compile('\$e\$')

titletranslate.py (https://github.com/malectro/Project-OPEN.git) Python · 162 lines

65 # ... unless we do want brackets

66 if removebrackets:

67 newname = re.sub(re.compile(ur"\W*?\(.*?\)\W*?", re.UNICODE), u" ", newname)

68 codesplit = codes.split(',')

69 codes = []

check_style_c_test.py (https://github.com/mgschwan/blensor.git) Python · 414 lines

387 import re

388 # E100

389 err_re_main = re.compile(r'.*\("(E\d+)"')

390 # E100.0

391 err_re_subv = re.compile(r'.*\("(E\d+)\.\d+"') # --> E100

392 err_re_subv_group = re.compile(r'.*\("(E\d+\.\d+)"') # --> E100.0

393 for l in fh:

394 g = err_re_subv.match(l)

apiclient-rax.py (https://gitlab.com/kawsark/pyrestclient) Python · 178 lines

19 #Load credentials from credentials_file variable

20 f = open(credentials_file, 'r')

21 pattern = re.compile("\s*\[rackspace_cloud\]\s*username\s*=\s*(\S*)\s*api_key\s*=\s*(\S*)")

22 match = pattern.search(f.read())

23 if match:

37

38 #Extract token from response:

39 p1 = re.compile("token.*\"id\":\"(.*?)\",")

40 m1 = p1.search(r.text)

41 token = m1.group(1)

42

43 #Extract tenantId from response:

44 p2 = re.compile("\"tenantId\":\"(\d*?)\",")

45 m2 = p2.search(r.text)

46 tenantId = m2.group(1)

marshal.py (https://github.com/nltk/nltk_contrib.git) Python · 206 lines

74 handler = file(filename, "r")

75

76 pattern = re.compile(r'^(.+):(.+?)$', re.UNICODE)

77 for line in handler.readlines():

78 m = re.match(pattern, line)

120 self._minlength = int(lines[1].split("minlength ")[1])

121

122 pattern = re.compile(r'^(.+):(.+?)$', re.UNICODE)

123 for line in lines[2:]:

124 m = re.match(pattern, line)

172

173

174 pattern = re.compile(r'^\[(.+)\]:(.+):(.+?)$', re.UNICODE)

175

176 # As the separator-char ":" can be used as a tag or as a text,

test_selector.py (https://github.com/mozilla/kuma-lib.git) Python · 200 lines

25 """Override the configuration to skip only specified files."""

26 c = Config()

27 c.ignoreFiles = [re.compile(r'^test_favourite_colour\.py$')]

28 s = Selector(c)

29

36 s = Selector(Config())

37 c = Config()

38 c.exclude = [re.compile(r'me')]

39 s2 = Selector(c)

40

47 s = Selector(Config())

48 c = Config()

49 c.include = [re.compile(r'me')]

50 s2 = Selector(c)

51

base.py (https://github.com/lithium/pyjirc.git) Python · 155 lines

19 self.handler = Handler(self.handle_message)

20 self.settings = settings

21 self._prefix_re = re.compile("(?P<nick>[^!]+)!(?P<user>[^@]+)@(?P<host>.+)")

22 self._jid_re = re.compile("(?P<node>[^@]+)@(?P<domain>[^/]+)(/(?P<resource>.+))?")

fields.py (https://github.com/asdahlborg/epiwork-website.git) Python · 182 lines

60 """

61 outcode_pattern = fullUKPostcodeField.outcode_pattern

62 postcode_regex = re.compile(r'^(GIR|%s)$' % outcode_pattern)

63

64 def clean(self, value):

test_mypy_plugin_py3k.py (https://bitbucket.org/zzzeek/sqlalchemy.git) Python · 210 lines

155

156 expected_errors = []

157 expected_re = re.compile(r"\s*# EXPECTED(_MYPY)?: (.+)")

158 py_ver_re = re.compile(r"^#\s*PYTHON_VERSION\s?>=\s?(\d+\.\d+)")

runner.py (https://github.com/argodev/BiLab.git) Python · 204 lines

62 self.vendors = []

63 self.table_stack = []

64 self.re_var = re.compile(r"\${(.*?)}")

65

66 def vendor(self):

po-merge.py (https://github.com/yuvrajm/subversion.git) Python · 191 lines

23 import os, re, sys

24

25 msgstr_re = re.compile('msgstr\[\d+\] "')

26

27 def parse_translation(f):

SearchIndex.py (https://github.com/mobyle2-legacy/mobyle2.core.git) Python · 133 lines

54 def filterRegistry(self, keywordList):

55 keywordList = [re.escape(k) for k in keywordList] # escape special re characters...

56 keywordsRe = re.compile('(%s)' % '|'.join(keywordList), re.I)

57 servicesList = getattr( registry, self.type + 's')[:]

58 for s in servicesList:

main.py (https://github.com/yasulab/author-evaluator.git) Python · 234 lines

66

67 def get_word_list(text):

68 p = re.compile(r'\W+')

69 list = p.split(text)

70 for i,word in enumerate(list):

utility.py (https://bitbucket.org/Nitesh_Rajpurohit/app-engine.git) Python · 493 lines

10

11 COL_NAMES = {}

12 range_parts = re.compile(r'(\$?)([A-Z]{1,3})(\$?)(\d+)')

13

14

policy.py (https://gitlab.com/ryandub/yoke) Python · 178 lines

45 raise NameError('Invalid HTTP verb ' + verb +

46 '. Allowed verbs in HttpVerb class')

47 resource_pattern = re.compile(self.path_regex)

48 if not resource_pattern.match(resource):

49 raise NameError('Invalid resource path: ' + resource +

middleware.py (https://github.com/joskid/ella.git) Python · 166 lines

23 self._excluded_urls = ()

24 for url in core_settings.DOUBLE_RENDER_EXCLUDE_URLS:

25 self._excluded_urls += (re.compile(url),)

26

27 return self._excluded_urls

__init__.py (https://github.com/plone/plone.i18n.git) Python · 215 lines

10

11 # Define and compile static regexes

12 FILENAME_REGEX = re.compile(r"^(.+)\.(\w{,4})$")

13 IGNORE_REGEX = re.compile(r"['\"]")

14 NON_WORD_REGEX = re.compile(r"[\W\-]+")

15 DANGEROUS_CHARS_REGEX = re.compile(r"[!$%&()*+,/:;<=>?@\\^{|}\[\]~`]+")

16 URL_DANGEROUS_CHARS_REGEX = re.compile(r"[!#$%&()*+,/:;<=>?@\\^{|}\[\]~`]+")

17 MULTIPLE_DASHES_REGEX = re.compile(r"\-+")

18 EXTRA_DASHES_REGEX = re.compile(r"(^\-+)|(\-+$)")

19 UNDERSCORE_START_REGEX = re.compile(r"(^_+)(.*)$")

20 LOCALE_SPLIT_REGEX = re.compile(r"[_-]")

21 # Define static constraints

22 MAX_LENGTH = 50

gpaw_out.py (https://gitlab.com/jennings.p.c/ase-f-ase) Python · 239 lines

29

30 def index_pattern(lines, pattern):

31 repat = re.compile(pattern)

32 if pattern in notfound:

33 raise ValueError

stringbench.py (https://github.com/albertz/CPython.git) Python · 1482 lines

122 # Try with regex

123 @uses_re

124 @bench('s="ABC"*33; re.compile(s+"D").search((s+"D")*300+s+"E")',

125 "late match, 100 characters", 100)

126 def re_test_slow_match_100_characters(STR):

130 s1 = (m+d)*300 + m+e

131 s2 = m+e

132 pat = re.compile(s2)

133 search = pat.search

134 for x in _RANGE_100:

plugin_mptt.py (https://github.com/bliving/sqlabs.git) Python · 395 lines

40

41 class TreeTestMixin():

42 leading_whitespace_re = re.compile(r'^\s+', re.MULTILINE)

43

44 def asserTree(self, nodes, tree_text):

test_locks.py (https://github.com/akheron/cpython.git) Python · 921 lines

14 r')\]>\Z'

15 )

16 RGX_REPR = re.compile(STR_RGX_REPR)

17

18

css.py (https://github.com/mfferreira/titanium_mobile.git) Python · 402 lines

30 return self.datum(unicode)

31

32 re_hexcolor = re.compile(r'#[0-9a-fA-F]{3,6}$')

33

34 class Hexcolor(SyntaxObject):

validate.py (https://github.com/netconstructor/modestmaps-py.git) Python · 378 lines

16

17 self.re = {

18 'coord' : re.compile(r"^-?\d+(?:\.\d+)?$"),

19 'adjust' : re.compile(r"^(\d+(?:\.\d*)?|\d*?\.\d+)$"),

20 'num' : re.compile(r"^\d+$"),

21 'provider' : re.compile(r"^(\w+)$"),

22 'label' : re.compile(r"^(?:[a-z0-9-_\.]+)$"),

23 'hull' : re.compile(r"^(marker|dot|plot)$")

EW_Compiler.py (https://gitlab.com/liuxin429go/build) Python · 393 lines

53 xprErr = "^" + "(?P<file>" + drvErr + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + ")" + linExp + "{0,1}" + errExp

54 xprWrn = "^" + "(?P<file>" + drvWrn + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + ")" + linExp + "{0,1}" + wrnExp

55 self.regexpError = re.compile(xprErr)

56 self.regexpWarning = re.compile(xprWrn)

70 xprErr = "^" + "(?P<file>" + drvErr + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + ")" + linExp + "{0,1}" + errExp

71 xprWrn = "^" + "(?P<file>" + drvWrn + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + ")" + linExp + "{0,1}" + wrnExp

72 self.regexpError = re.compile(xprErr)

73 self.regexpWarning = re.compile(xprWrn)

141 xprErr = "^" + "(?P<file>" + drvErr + "?" + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + "{0,1}" + ")" + linExp + "{0,1}" + errExp

142 xprWrn = "^" + "(?P<file>" + drvWrn + "?" + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + "{0,1}" + ")" + linExp + "{0,1}" + wrnExp

143 self.regexpError = re.compile(xprErr)

144 self.regexpWarning = re.compile(xprWrn)

196 xprErr = "^" + "(?P<file>" + drvErr + "?" + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + "{0,1}" + ")" + linExp + "{0,1}" + errExp

197 xprWrn = "^" + "(?P<file>" + drvWrn + "?" + dirExp + "*" + filExp + ")" + "(?P<line>" + linExp + "{0,1}" + ")" + linExp + "{0,1}" + wrnExp

198 self.regexpError = re.compile(xprErr)

199 self.regexpWarning = re.compile(xprWrn)

Core.py (https://gitlab.com/Asnelchristian/coala-utils) Python · 513 lines

197 # Compilation of the begin sequence is needed to get the number of

198 # capturing groups in it.

199 begin_pattern_groups = re.compile(begin).groups

200

201 # Regex explanation:

269 # Compilation of the begin sequence is needed to get the number of

270 # capturing groups in it.

271 begin_pattern_groups = re.compile(begin).groups

272

273 # Regex explanation:

test_schema.py (https://github.com/okoye/json-schema-validator.git) Python · 773 lines

435 # 'schema': '{"pattern": "foo|bar"}',

436 # 'expected': {

437 # 'pattern': re.compile('foo|bar'),

438 # },

439 #}),

base.py (https://github.com/wdzhou/mantid.git) Python · 216 lines

3 import re

4

5 ALG_DOCNAME_RE = re.compile(r'^([A-Z][a-zA-Z0-9]+)-v([0-9][0-9]*)$')

6 FIT_DOCNAME_RE = re.compile(r'^([A-Z][a-zA-Z0-9]+)$')

mbpt_lcao_utils.py (https://gitlab.com/ansobolev/ase) Python · 286 lines

156 (?: [Ee] [+-]? \d+ ) ?

157 """

158 rx = re.compile(numeric_const_pattern, re.VERBOSE)

159

160 nb = rx.findall(string)

176 (?: [Ee] [+-]? \d+ ) ?

177 """

178 rx = re.compile(numeric_const_pattern, re.VERBOSE)

179

180 nb = rx.findall(string)

make-release.py (git://github.com/mitsuhiko/werkzeug.git) Python · 154 lines ✨ Summary

This script automates the process of releasing a Python package, specifically Werkzeug. It parses the changelog to determine the current version and release date, bumps the version number, sets the version in the __init__.py file, commits the changes, tags the new version, builds and uploads the package as source distributions (sdist) and wheel files.

18 from subprocess import Popen, PIPE

19

20 _date_clean_re = re.compile(r'(\d+)(st|nd|rd|th)')

21

22