Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Oct 12, 2023
1 parent bd3e6a9 commit 1de13ea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion background_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def run(self):
sync_gaps = get_sync_gaps(self.blockprint_url)
chunks = explode_gaps(sync_gaps)

for (start_slot, end_slot) in chunks:
for start_slot, end_slot in chunks:
print(f"Downloading backfill blocks {start_slot}..={end_slot}")
block_rewards = download_block_rewards(
start_slot, end_slot, beacon_node=self.bn_url
Expand Down
4 changes: 2 additions & 2 deletions build_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_sync_gaps(block_db):
missing_parent_slots = get_missing_parent_blocks(block_db)
gaps = []

for (block_slot, parent_slot) in missing_parent_slots:
for block_slot, parent_slot in missing_parent_slots:
prior_slot = get_greatest_prior_block_slot(block_db, parent_slot)

if prior_slot is None:
Expand Down Expand Up @@ -221,7 +221,7 @@ def get_blocks_per_client(block_db, start_slot, end_slot):
(start_slot, end_slot),
)

for (client, count) in client_counts:
for client, count in client_counts:
blocks_per_client[client] = int(count)

return blocks_per_client
Expand Down
4 changes: 2 additions & 2 deletions compute_periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def get_validators_per_client(period_db, period_id, guess_column=DEFAULT_GUESS):
(period_id,),
)

for (client, count) in client_counts:
for client, count in client_counts:
validators_per_client[client] = int(count)

return validators_per_client
Expand All @@ -339,7 +339,7 @@ def period_db_to_csv(period_db, output_file, guess_column=DEFAULT_GUESS):

periods = period_db.execute("SELECT * FROM periods")

for (period_id, end_slot, num_active_validators) in periods:
for period_id, end_slot, num_active_validators in periods:
row = {
"period_id": period_id,
"end_slot": end_slot,
Expand Down
2 changes: 1 addition & 1 deletion multi_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, data_dir):
def classify(self, block_reward):
slot = int(block_reward["meta"]["slot"])

for (i, (start_slot, end_slot, classifier)) in enumerate(self.classifiers):
for i, (start_slot, end_slot, classifier) in enumerate(self.classifiers):
# Allow the last classifier to be used for slots beyond its end slot
if start_slot <= slot and (
slot <= end_slot or i + 1 == len(self.classifiers)
Expand Down
4 changes: 2 additions & 2 deletions prepare_training_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


def check_graffiti(graffiti: str, disabled_clients=[]) -> str:
for (client, regexes) in REGEX.items():
for client, regexes in REGEX.items():
if client in disabled_clients:
continue

Expand Down Expand Up @@ -66,7 +66,7 @@ def process_file(

res = classify_rewards_by_graffiti(rewards, disabled_clients=disabled_clients)

for (client, examples) in res.items():
for client, examples in res.items():
for block_rewards in examples:
store_block_rewards(block_rewards, client, proc_data_dir)

Expand Down

0 comments on commit 1de13ea

Please sign in to comment.