MCPcopy
hub / github.com/twitter/communitynotes / time_block

Method time_block

scoring/src/scoring/scorer.py:62–70  ·  view source on GitHub ↗
(self, label)

Source from the content-addressed store, hash-verified

60
61 @contextmanager
62 def time_block(self, label):
63 start = time.time()
64 try:
65 yield
66 finally:
67 end = time.time()
68 logger.info(
69 f"{self.get_name()} {label} elapsed time: {end - start:.2f} secs ({((end-start)/60.0):.2f} mins)"
70 )
71
72 def get_name(self):
73 return str(type(self))

Callers 15

prescoreMethod · 0.95
score_finalMethod · 0.95
compute_scored_notesFunction · 0.80
score_notesMethod · 0.80
score_notesMethod · 0.80
score_notesMethod · 0.80
apply_scoring_rulesFunction · 0.80
aggregate_into_cliquesFunction · 0.80
_make_rater_stats_dfFunction · 0.80
_get_pair_countsFunction · 0.80

Calls 1

get_nameMethod · 0.95

Tested by

no test coverage detected