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

Method categorize

scripts/release_notes/categorize.py:49–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 self.category = category
48
49 def categorize(self):
50 commits = self.commits.filter(category=self.category)
51 total_commits = len(self.commits.commits)
52 already_done = total_commits - len(commits)
53 i = 0
54 while i < len(commits):
55 cur_commit = commits[i]
56 next_commit = commits[i + 1] if i + 1 < len(commits) else None
57 jump_to = self.handle_commit(
58 cur_commit, already_done + i + 1, total_commits, commits
59 )
60
61 # Increment counter
62 if jump_to is not None:
63 i = jump_to
64 elif next_commit is None:
65 i = len(commits)
66 else:
67 i = commits.index(next_commit)
68
69 def features(self, commit):
70 return self.cache.get(commit.commit_hash)

Callers 1

mainFunction · 0.95

Calls 3

handle_commitMethod · 0.95
filterMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected