MCPcopy Create free account
hub / github.com/pytorch/pytorch / parse_pr_number

Function parse_pr_number

scripts/release_notes/common.py:176–186  ·  view source on GitHub ↗
(body, commit_hash, title)

Source from the content-addressed store, hash-verified

174
175
176def parse_pr_number(body, commit_hash, title):
177 regex = r"Pull Request resolved: https://github.com/pytorch/pytorch/pull/([0-9]+)"
178 matches = re.findall(regex, body)
179 if len(matches) == 0:
180 if "revert" not in title.lower() and "updating submodules" not in title.lower():
181 print(f"[{commit_hash}: {title}] Could not parse PR number, ignoring PR")
182 return None
183 if len(matches) > 1:
184 print(f"[{commit_hash}: {title}] Got two PR numbers, using the first one")
185 return matches[0]
186 return matches[0]
187
188
189def get_ghstack_token():

Callers 1

get_featuresFunction · 0.85

Calls 1

lowerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…