This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from models.match import Match | |
| matches = Match.query(Match.year==2017).fetch() | |
| near_count = 0 | |
| middle_count = 0 | |
| far_count = 0 | |
| for match in matches: | |
| for color in ['red', 'blue']: | |
| if not match.score_breakdown: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from models.subscription import Subscription | |
| from collections import defaultdict | |
| counts = defaultdict(int) | |
| for s in Subscription.query(Subscription.model_type==1).fetch(): | |
| counts[s.model_key] += 1 | |
| sorted_counts = sorted(counts.items(), key=lambda x: -x[1]) | |
| for team, count in sorted_counts[:100]: | |
| print team, count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from helpers.event_helper import EventHelper | |
| events = EventHelper.getWeekEvents() | |
| gear_stats = {} | |
| for event in events: | |
| predictions = event.details.predictions | |
| if predictions and predictions.get('stat_mean_vars'): | |
| for team, val in predictions['stat_mean_vars']['qual']['gears']['mean'].items(): | |
| gear_stats[team] = val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| from models.event import Event | |
| events = Event.query().filter( | |
| Event.start_date >= datetime.datetime(2017, 3, 29)).filter( | |
| Event.start_date <= datetime.datetime(2017, 4, 2)).order( | |
| Event.start_date).fetch() | |
| gear_stats = {} | |
| pressure_stats = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from consts.event_type import EventType | |
| from database.team_query import EventTeamsQuery | |
| from database.event_query import TeamYearEventsQuery | |
| teams = EventTeamsQuery('2017hop').fetch() | |
| team_events_futures = [] | |
| for team in teams: | |
| team_events_futures.append(TeamYearEventsQuery(team.key.id(), 2017).fetch_async()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from consts.account_permissions import AccountPermissions | |
| from consts.media_type import MediaType | |
| from controllers.suggestions.suggestions_review_base_controller import SuggestionsReviewBaseController | |
| from google.appengine.ext import ndb | |
| import json | |
| from models.media import Media | |
| from models.suggestion import Suggestion | |
| from helpers.suggestions.media_creator import MediaCreator | |
| from helpers.media_manipulator import MediaManipulator | |
| from helpers.user_bundle import UserBundle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import urlfetch | |
| url_format = 'https://api.nightbot.tv/1/logs?columns%5B0%5D%5Bdata%5D=createdAt&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=user.displayName&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=false&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=message&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=false&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=desc&start={}&length=100&search%5Bvalue%5D=&search%5Bregex%5D=false' | |
| offset = 0 | |
| all_messages = [] | |
| while True: | |
| response = urlfetch.get( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Event Key | Team Key | Date | Time (UTC) | |
|---|---|---|---|---|
| 2018azpx | frc698 | 2017-09-28 | 18:34:16.021150 | |
| 2018azpx | frc991 | 2017-09-28 | 18:34:16.021360 | |
| 2018azpx | frc1290 | 2017-09-28 | 18:34:16.021540 | |
| 2018azpx | frc1492 | 2017-09-28 | 18:34:16.021670 | |
| 2018azpx | frc1633 | 2017-09-28 | 18:34:16.021980 | |
| 2018azpx | frc2375 | 2017-09-28 | 18:34:16.022310 | |
| 2018azpx | frc2403 | 2017-09-28 | 18:34:16.105460 | |
| 2018azpx | frc2647 | 2017-09-28 | 18:34:16.106810 | |
| 2018azpx | frc2662 | 2017-09-28 | 18:34:16.108040 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Time | Mode | Red Score | Blue Score | Red Fuel | Blue Fuel | Red Rotors | Blue Rotors | Red Touchpads | Blue Touchpads | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | pre_match | 0 | 0 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 14 | auto | 0 | 0 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 13 | auto | 0 | 0 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 12 | auto | 0 | 15 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 11 | auto | 15 | 15 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 10 | auto | 15 | 15 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 9 | auto | 15 | 15 | 0 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 8 | auto | 16 | 15 | 1 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 | |
| 7 | auto | 21 | 15 | 6 + 0/9 | 0 + 0/9 | 0 | 0 | 0 | 0 |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 31 columns, instead of 22 in line 4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| time,matchKey,matchName,mode,timeRemaining,redScore,redForceCount,redForcePlayed,redLevitateCount,redLevitatePlayed,redBoostCount,redBoostPlayed,redScaleOwned,redSwitchOwned,redCurrentPowerup,redPowerupTimeRemaining,redAutoQuest,redFaceTheBoss,blueScore,blueForceCount,blueForcePlayed,blueLevitateCount,blueLevitatePlayed,blueBoostCount,blueBoostPlayed,blueScaleOwned,blueSwitchOwned,blueCurrentPowerup,bluePowerupTimeRemaining,blueAutoQuest,blueFaceTheBoss | |
| 2018-02-17 15:57:54.621448,f1m1,Final 1,auto,14,0,0,False,0,False,0,False,False,False,,,False,False,0,0,False,0,False,0,False,False,False,,,False,False | |
| 2018-02-17 15:57:55.621448,f1m1,Final 1,auto,13,0,0,False,0,False,0,False,False,False,,,False,False,0,0,False,0,False,0,False,False,False,,,False,False | |
| 2018-02-17 15:57:56.621448,f1m1,Final 1,auto,12,5,0,False,0,False,0,False,False,False,,,False,False,0,0,False,0,False,0,False,False,False,,,False,False | |
| 2018-02-17 15:57:57.621448,f1m1,Final 1,auto,11,5,0,False,0,False,0,False,False,False,,,False,False,0,0,False, |
OlderNewer