index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
44,660
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/match/load.py
#!/usr/bin/env python3 from bs4 import BeautifulSoup import logging import json import sys from os import listdir import os.path from match import parse from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def parse_match(filename): if (filename.startswith("match")): retu...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,661
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/player/parse_profile.py
#!/usr/bin/env python """ Parse player from HTML file """ import sys import re import dateutil.parser as parser import logging from bs4 import BeautifulSoup from bs4.element import NavigableString LOG = logging.getLogger(__package__) def row_with_heading(table, heading): LOG.debug("Searching for heading {}".form...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,662
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/collate.py
#!/usr/bin/env python3 import os import sys import json from match import match from coach import coach from team import team from player import player from . import collate_coach from . import collate_match from . import collate_team from . import collate_player from importer.bbleague.defaults import BASEPATH def l...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,663
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/elo.py
import logging LOG = logging.getLogger(__package__) START_RATING = 0 def expected(A, B): """ Calculate expected score of A in a match against B :param A: Elo rating for player A :param B: Elo rating for player B """ return 1 / (1 + 10 ** ((B - A) / 150)) def elo(old, exp, score, k=10): ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,664
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/export.py
#!/usr/bin/env python3 import jinja2 from match import match from team import team from coach import coach from stats.team_list import list_all_teams_by_points, list_all_games_by_race from stats.match_list import list_all_matches, list_all_games_by_year from stats.team_list import format_for_total, format_for_average f...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,665
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/race_data.py
#!/usr/bin/env python3 import logging from team import team from stats.team_list import list_all_teams_by_points, list_all_games_by_race from stats.match_list import list_all_matches, list_all_games_by_year from stats.team_list import format_for_total, format_for_average from stats import match_list import stats.elo im...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,666
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/bblparser/tests/test_models.py
from bblparser.models import Link def test_link_get_link_return_str(): assert Link(href=None, onclick=None, text='Heading').get_link() is None onclick_link = "self.location.href='?p=rs&s=34';" assert 'the_base+?p=rs&s=34' == Link(href=None, onclick=onclick_link, text='Heading').get_link(base='the_base+')...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,667
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/match/parse.py
#!/usr/bin/env python """ Parse match from HTML """ import re import sys import logging import dateutil.parser as parser import bs4 LOG = logging.getLogger(__package__) def id_from_a(a): if a.has_attr("href"): return a["href"][a["href"].rfind("=") + 1:] if a.parent and a.parent.has_attr("href"): ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,668
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/bblparser/page.py
import io import logging import pathlib import typing import sys import bs4 from bblparser.models import Page, Link import bblparser.load LOG = logging.getLogger(__name__) def _parse_link(el: bs4.element.Tag) -> Link: onclick = el.get('onclick') if el.has_attr('onclick') else None return Link(text=el.text,...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,669
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/match_list.py
#!/usr/bin/env python3 import dateutil from operator import itemgetter from copy import copy import logging import pprint import sys from match import match LOG = logging.getLogger(__package__) def game_streaks(games): streaks = {} streaks["gamestreak"] = playstreak(games) streaks["winstreak"] = events...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,670
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/team/parse.py
#!/usr/bin/env python from bs4 import BeautifulSoup from unicodedata import normalize import re import logging from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def find_rows(soup): LOG.debug("Find rows") teams = [] rows = soup.find_all("tr") LOG.debug("Found {} row...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,671
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/tournament/pairing.py
#!/usr/bin/env python """ Match teams for round """ import sys import logging LOG = logging.getLogger(__package__) def pairing(standings, matches, type="swiss"): if not standings: raise ValueError("standings are None or empty") return swiss_pairing(standings, matches) def match_played(home_team, a...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,672
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/team/create.py
#!/usr/bin/env python """ Create new team """ import sys import logging import scrape.session LOG = logging.getLogger(__package__) def create_team(team_name, race, coach, co_coach, session): LOG.debug("Creating team '%s' '%s' '%s' '%s'", team_name, race, coach, co_coach) team_form = {"coach": coach, ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,673
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/scrape/fetchplayer.py
#!/bin/env python3 import sys import requests import os.path from time import sleep import scrape.session from importer.bbleague.defaults import BASEPATH base_url = "https://www.anarchy.bloodbowlleague.net/default.asp?p=pl&pid={}" admin_url = "https://www.anarchy.bloodbowlleague.net/default.asp?p=pladm&pid={}" def ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,674
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/team_data.py
#!/usr/bin/env python3 from match import match from stats import team_list from stats import match_list from stats import coach_list from export import export, coach_data, race_data from team import team from export import index import datetime #coach = coach_list.coach_data(coach, coach_games), def team_stats(dat...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,675
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/collate_test.py
#!/usr/bin/python3 import pprint import stats.collate import sys def pretty(value): pprint.pprint(value, indent=2) def match_sans_coach(data): no_coachid = [match["matchid"] for match in data["game"].values() if match["away_coachid"] in ["-1", 0, -1, "0", None] or match["home_coachid"] in ["0","-1", 0, -1, No...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,676
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/team/fetch-team.py
#!/bin/env python3 import urllib.request from urllib.error import HTTPError from time import sleep base_url = "http://www.anarchy.bloodbowlleague.com/default.asp?p=pl&pid={}" for playerid in range(5, 3341): print(base_url.format(playerid)) try: with urllib.request.urlopen(base_url.format(playerid)) as respons: ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,677
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/coach/parse.py
#!/usr/bin/env python import sys import os.path import logging from bs4 import BeautifulSoup from unicodedata import normalize import datetime from importer.bbleague.defaults import BASEPATH #import dateutil.parser as parser NEVER_LOGGED_IN = "2000-01-01T00:00:01" LOG = logging.getLogger(__package__) def find_rows(...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,678
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/team/team.py
#!/usr/bin/env python from bs4 import BeautifulSoup from unicodedata import normalize import datetime import re from . import parse import collections from importer.bbleague.defaults import BASEPATH def dict_teams(): teams = list_teams() result = {} for team in teams: result[team["id"]] = team ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,679
ketilkn/bloodbowl-utility
refs/heads/master
/skills/skills-html.py
#!/bin/env python3 linjer = open("skills.txt", "r").readlines() skill = {} skills = [] for linje in linjer: if not linje.strip(): skills.append(skill) skill = None continue elif not skill: title = linje[0: linje.find("(")].strip() id = title.strip().replace(" ", "-").lower() category = linje[linje.fin...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,680
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/importer/bbleague/__main__.py
#!/usr/bin/env python """ default functionality for bbleague importer """ import sys import logging import argparse import importer.bbleague.update LOG = logging.getLogger(__package__) def main(): log_format = "[%(levelname)s:%(filename)s:%(lineno)s - %(funcName)20s ] %(message)s" logging.basicConfig(level...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,681
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/tournament/parse.py
#!/usr/bin/env python import sys from bs4 import BeautifulSoup import logging def id_from_onclick(el): if el and el.has_attr("onclick"): return el["onclick"][el["onclick"].find("'")+1:el["onclick"].rfind("'")] return "teamid not found {}".format(el.name) def parse_team(team): team_name = team ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,682
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/bblparser/load.py
import logging import pathlib import sys import typing LOG = logging.getLogger(__name__) def load_raw(file_no) -> str: with open(file_no, mode='rb', closefd=False) as f: raw_input = f.read() try: return raw_input.decode('utf-8') except UnicodeDecodeError: return ra...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,683
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/importer/bbleague/defaults.py
#!/usr/bin/env python """ Default values for bloodbowlleague importerer """ import logging LOG = logging.getLogger(__package__) BASEPATH = "input/anarchy.bloodbowlleague.com/" def main(): log_format = "[%(levelname)s:%(filename)s:%(lineno)s - %(funcName)20s ] %(message)s" logging.basicConfig(level=logging.D...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,684
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/player_data.py
#!/usr/bin/env python3 import datetime import os import logging import export.filter import stats.player_list from . import export from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def make_top_list(players, name, key, heading="Most experienced", order=stats.player_list.order_by_sp...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,685
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/match/fetch.py
#!/bin/env python3 """fetch all games from anarchy blood bowl league""" import os.path import sys import urllib.request from urllib.error import HTTPError from time import sleep from bs4 import BeautifulSoup import logging from importer.bbleague.defaults import BASEPATH BASE_URL = "{}/default.asp?p=m&m={}" DATA_URL = ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,686
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/scrape/fetch_coachlist.py
#!/bin/env python3 import sys import os.path import scrape.session import logging LOG = logging.getLogger(__name__) coaches_url = "/default.asp?p=co" def download_coach_list(base_url, username, password, base_path): login_url = "{}/login.asp".format(base_url) s = scrape.session.login(login_url, username=use...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,687
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/coach/parse_from_team.py
#!/usr/bin/env python """ Create list of coaches from team list for use when actual coach list is missing. """ import sys import os.path import logging from .coach import parse import team.parse from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def create_coach(nick, uid): c...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,688
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/collate_match.py
#!/usr/bin/env python3 import logging from coach import coach LOG = logging.getLogger(__package__) def add_team_race(data): for g in data["game"].values(): g["home_race"] = data["team"][g["home_teamid"]]["race"] g["away_race"] = data["team"][g["away_teamid"]]["race"] return data["game"] def...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,689
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/tournament/parse_matches.py
#!/usr/bin/env python import sys from bs4 import BeautifulSoup import logging LOG = logging.getLogger(__name__) def id_from_onclick(el): if el and el.has_attr("onclick"): return el["onclick"][el["onclick"].rfind("=")+1:el["onclick"].rfind("'")] return "teamid not found {}".format(el.name) def parse...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,690
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/bblparser/models.py
from dataclasses import dataclass import typing @dataclass class Link: href: str onclick: str text: str def get_link(self, base='http://anarchy.bloodbowlleague.com/'): if self.href: return "{base}{href}".format(base=base, href=self.href) if self.onclick: onclic...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,691
ketilkn/bloodbowl-utility
refs/heads/master
/skills/skills.py
#!/bin/env python3 import simplejson linjer = open("skills.txt", "r").readlines() skill = {} skills = {} for linje in linjer: if not linje.strip(): skills[skill['id']] = skill skill = None continue elif not skill: title = linje[0: linje.find("(")].strip() id = title.strip().replace(" ", "-").lower() ca...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,692
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/collate_player.py
#!/usr/bin/env python3 import os import json import logging from match import match from coach import coach from team import team from player import player from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def hide_invalid_players(players): for p in players.values(): p["inv...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,693
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/collate_coach.py
#!/usr/bin/env python3 import os import sys import json import logging from match import match from coach import coach from team import team from player import player from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def collate_coach(data): for coach in data["coach"].values():...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,694
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/player_list.py
#!/usr/bin/env python """ Functions to list and filter league players """ import sys import logging import stats.collate from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def order_by_pid(players): """order list of players by player.player_id""" return sorted(players, ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,695
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/__main__.py
#!/usr/bin/env python3 from export import all_data if __name__ == '__main__': all_data.export_all_data()
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,696
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/coach_data.py
#!/usr/bin/env python3 from copy import deepcopy from match import match from team import team from coach import coach from stats import coach_list from stats import team_list from stats import match_list import stats.elo from export import export import dateutil.parser from datetime import date from stats.collate i...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,697
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/player/parse.py
#!/usr/bin/env python """ Parse player from HTML file """ import sys import re import dateutil.parser as parser import logging from bs4 import BeautifulSoup from bs4.element import NavigableString from player import parse_admin from . import parse_profile LOG = logging.getLogger(__package__) def parse_fromfile(pat...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,698
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/player/parse_admin.py
#!/usr/bin/env python """ Parse player from HTML file """ import sys import re import dateutil.parser as parser import logging from bs4 import BeautifulSoup from bs4.element import NavigableString LOG = logging.getLogger(__package__) def parse_date(soup): LOG.debug("CREATION DATE >==-") indates = soup.selec...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,699
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/tournament/test_pairing.py
#!/usr/bin/env python """ Test tournament pairing """ import sys import pytest import logging from tournament.pairing import swiss_pairing, pairing, match_played, find_opponent LOG = logging.getLogger(__package__) STANDINGS = [{'name': 'test team 2', 'position': 1, 'teamid': 'tes2'}, {'name': 'Test team K', 'positio...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,700
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/collate_team.py
#!/usr/bin/env python3 import os import json import logging from match import match from coach import coach from team import team from player import player from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def collate_team(data): for team in data["team"].values(): team["...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,701
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/scrape/fetch_teamlist.py
#!/bin/env python3 import sys import os.path import logging import scrape.session LOG = logging.getLogger(__package__) teams_script = "default.asp?p=te" def download(session, url, path): pass def download_team_list(base_url, username, password, base_path): LOG.debug("Download teamlist from %s to %s", base...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,702
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/coach_list.py
#!/usr/bin/env python3 import dateutil import datetime from datetime import date from operator import itemgetter from copy import deepcopy from match import match from team import team from coach import coach from stats.match_list import list_all_matches from stats.match_list import games_for_year, we_are_coach, sum_...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,703
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/player/load.py
#!/usr/bin/env python3 """ Parse players from HTML""" import sys import os.path import json import logging from bs4 import BeautifulSoup from player import parse from importer.bbleague.defaults import BASEPATH LOG=logging.getLogger(__name__) def from_file(filename): html = open(filename, "rb").read() soup ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,704
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/scrape/session.py
#!/usr/bin/env python3 import requests import sys import logging LOG = logging.getLogger(__package__) USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36' ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,705
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/match/create.py
#!/usr/bin/env python """ Create new team """ import sys import logging import scrape.session LOG = logging.getLogger(__package__) def create_match(session, tournament_id, home_id, away_id, tround, mdate=None, tournament_match=True): LOG.debug("Creating match '%s' '%s' '%s' '%s' '%s' '%s'", tournament_id, home_...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,706
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/match/test_parse.py
from bs4 import BeautifulSoup import match.parse def test_parse_match_works_for_unplayed(): soup = BeautifulSoup(open("match/testdata/unplayed_match.html", "rb").read().decode("iso-8859-1"), "lxml") played_match = match.parse.parse_match(1161, soup) assert "approved" in played_match assert not played_...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,707
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/index.py
#!/usr/bin/env python3 """Create index file for dataset. Require template index.html""" import datetime from team import team from coach import coach from stats.match_list import list_all_matches from export import export def create_index(data): """Create and return a template containing site index""" games ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,708
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/player/player.py
#!/usr/bin/env python3 """ Python libraries for Dr.Tide""" import sys import os import os.path import collections import logging import json import player.load from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def load_fromjson(basepath = BASEPATH, filepath="json/players.json"): ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,709
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/match/match.py
#!/usr/bin/env python3 import logging from match import load from match import parse LOG = logging.getLogger(__package__) def open_match(filename): matchid = filename[filename.find("match-") + 6:filename.rfind(".html")] return parse.parse_match(matchid, load.from_file(filename)) def collate_gamedata(games...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,710
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/importer/bbleague/update.py
#!/usr/bin/env python """ Import data from bloodbowlleague.com """ import sys import logging import scrape.fetch_teamlist import scrape.fetch_coachlist import match.fetch LOG = logging.getLogger(__package__) def load_config(section): import configparser config = configparser.ConfigParser() LOG.info("Lo...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,711
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/stats/team_list.py
#!/usr/bin/env python3 from collections import Counter import copy from operator import itemgetter import logging from match import match from team import team from coach import coach LOG = logging.getLogger(__package__) def team_data(the_team, team_matches): data_for_team = {} data_for_team["head_coach"] = ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,712
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/all_data.py
#!/usr/bin/env python3 """Run the entire process of generating stats and exporting to HTML. Run from commandline or as an import. Progess is written to stdout using print""" import datetime from export import game_data, coach_data, race_data, index, team_data, player_data def export_all_data(config=None): """Expo...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,713
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/game_data.py
#!/usr/bin/env python3 """Write all game data to disk using jinja2 templates""" import datetime from team import team from stats.team_list import list_all_teams_by_points, list_all_games_by_race from stats.match_list import list_all_matches, list_all_games_by_year from stats.team_list import format_for_total, format_fo...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,714
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/export/filter.py
def coach_anchor(input): #return input if not input: return "None" return "<a href='coach/{}.html'>{}</a>".format(input.replace(' ','-'), input) def team_value(input): if not input: return "Unknown" return "{}k".format(int(input/1000)) def race_short(input): lowered_input = i...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,715
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/coach/coach.py
#!/usr/bin/env python import sys import os import json import logging from coach import parse import coach.parse_from_team from importer.bbleague.defaults import BASEPATH LOG = logging.getLogger(__package__) def dict_coaches(use_key="nick"): coaches = list_coaches() result = {} for coach in coaches: ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,716
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/importer/__main__.py
#!/usr/bin/env python3 import sys from importer import bbleague if __name__ == '__main__': host = "www.anarchy.bloodbowlleague.com" username = sys.argv[1] password = sys.argv[2] bbleague.import_bloodbowlleague(host, username, password) #all_data.export_all_data()
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,717
ketilkn/bloodbowl-utility
refs/heads/master
/bbl-scraper/player/display.py
#!/usr/env python3 import sys import player.player from .load import load_all def plformat(p): return "{:>4} {:>32} {:>18} t:{:<4} c:{:>2} p:{:>3} i:{:>2} m:{:>2} g:{:>2} *:{:>3} {} {}".format( p["playerid"], p["playername"], p["position"][:18], p["team"] if p["team"] else "0000", ...
{"/bbl-scraper/coach/parse_from_team.py": ["/bbl-scraper/coach/coach.py"], "/bbl-scraper/player/display.py": ["/bbl-scraper/player/load.py"]}
44,718
manu621311/ss42
refs/heads/master
/company/api/urls.py
from django.urls import path from rest_framework.routers import DefaultRouter from . import views urlpatterns = [ path('register/', views.Company.as_view({'post': 'create'})), path('view/', views.CompanyRead.as_view({'get': 'list'})), path('post/', views.PostViewSet.as_view({'get': 'list'})), ]
{"/company/api/views.py": ["/company/models.py"]}
44,719
manu621311/ss42
refs/heads/master
/accounts/urls.py
from .views import create_verification, confirm_verification from django.urls import path urlpatterns = [ path('create/<int:id>', create_verification), path('confirm/<str:complex>/<int:id>/<int:otp>', confirm_verification), ]
{"/company/api/views.py": ["/company/models.py"]}
44,720
manu621311/ss42
refs/heads/master
/company/models.py
from django.db import models from django.contrib.auth.models import User class Company(models.Model): dev_name = models.CharField(max_length=80, null=False) company_name = models.CharField(max_length=80, null=True) email = models.EmailField(null=False) city = models.CharField(max_length=100, null=Fals...
{"/company/api/views.py": ["/company/models.py"]}
44,721
manu621311/ss42
refs/heads/master
/company/api/views.py
import json from rest_framework.views import APIView from rest_framework import viewsets from rest_framework.response import Response from rest_framework.permissions import IsAuthenticatedOrReadOnly, AllowAny from rest_framework_api_key.permissions import HasAPIKey from rest_framework_jwt.authentication import JSONWebT...
{"/company/api/views.py": ["/company/models.py"]}
44,725
andrewixl/satoshitraveler
refs/heads/master
/apps/login_app/models.py
from __future__ import unicode_literals from django.db import models import re import bcrypt # Create your models here. class UserManager(models.Manager): def registerVal(self, postData): results = {'status': True, 'errors': [], 'user': None} if len(postData['first_name']) < 3: results['status'] = False re...
{"/apps/main/views.py": ["/apps/login_app/models.py"]}
44,726
andrewixl/satoshitraveler
refs/heads/master
/apps/login_app/urls.py
from . import views from django.conf.urls import url def test(request): print 'in app' urlpatterns = [ url(r'^login$', views.index), url(r'^register$', views.register), url(r'^login_verify$', views.login_verify), url(r'^logout$', views.logout), ]
{"/apps/main/views.py": ["/apps/login_app/models.py"]}
44,727
andrewixl/satoshitraveler
refs/heads/master
/apps/main/views.py
from django.shortcuts import render, redirect from ..login_app.models import User # Create your views here. def index(request): return render(request, 'main/index.html') def dashboard(request): try: request.session['user_id'] except KeyError: return redirect("/login") user = User.objec...
{"/apps/main/views.py": ["/apps/login_app/models.py"]}
44,728
andrewixl/satoshitraveler
refs/heads/master
/apps/login_app/migrations/0002_auto_20180611_0949.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2018-06-11 16:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('login_app', '0001_initial'), ] operations = [ migrations.AddField( ...
{"/apps/main/views.py": ["/apps/login_app/models.py"]}
44,729
andrewixl/satoshitraveler
refs/heads/master
/apps/login_app/urls-100000000000001.py
from . import views from django.conf.urls import url def test(request): print 'in app' urlpatterns = [ url(r'^login', views.index), url(r'^register', views.register), url(r'^verify', views.login), url(r'^logout', views.logout), ]
{"/apps/main/views.py": ["/apps/login_app/models.py"]}
44,750
yashinil/HappyHearts
refs/heads/master
/health/inventorysite/inventoryapp/admin.py
from django.contrib import admin from .models import Lender,Borrower #class PlaceAdmin(admin.ModelAdmin): # list_display = ('product_name') #admin.site.register(Lender,LenderAdmin) admin.site.register(Lender) admin.site.register(Borrower)
{"/health/inventorysite/inventoryapp/admin.py": ["/health/inventorysite/inventoryapp/models.py"], "/health/inventorysite/inventoryapp/views.py": ["/health/inventorysite/inventoryapp/models.py"]}
44,751
yashinil/HappyHearts
refs/heads/master
/health/inventorysite/inventorysite/forms.py
from django import forms from django.contrib.auth.models import User class LenderForm(forms.Form): lender = forms.CharField() product_name = forms.CharField() product_description = forms.CharField() department=forms.CharField() safety_deposit=forms.IntegerField() contact_number=forms.IntegerFi...
{"/health/inventorysite/inventoryapp/admin.py": ["/health/inventorysite/inventoryapp/models.py"], "/health/inventorysite/inventoryapp/views.py": ["/health/inventorysite/inventoryapp/models.py"]}
44,752
yashinil/HappyHearts
refs/heads/master
/health/inventorysite/inventoryapp/migrations/0003_auto_20200202_0827.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2020-02-02 08:27 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inventoryapp', '0002_auto_20200201_2038'), ] operations = [ migrations.Alt...
{"/health/inventorysite/inventoryapp/admin.py": ["/health/inventorysite/inventoryapp/models.py"], "/health/inventorysite/inventoryapp/views.py": ["/health/inventorysite/inventoryapp/models.py"]}
44,753
yashinil/HappyHearts
refs/heads/master
/health/inventorysite/inventoryapp/views.py
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.models import User from .models import Lender,Borrower from django.utils import timezone from django.contrib.auth import authenticate, login, logout from django.http import HttpResponseRedirect, HttpResponse from django.contrib....
{"/health/inventorysite/inventoryapp/admin.py": ["/health/inventorysite/inventoryapp/models.py"], "/health/inventorysite/inventoryapp/views.py": ["/health/inventorysite/inventoryapp/models.py"]}
44,754
yashinil/HappyHearts
refs/heads/master
/health/inventorysite/inventoryapp/migrations/0002_auto_20200201_2038.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2020-02-01 20:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inventoryapp', '0001_initial'), ] operations = [ migrations.CreateModel( ...
{"/health/inventorysite/inventoryapp/admin.py": ["/health/inventorysite/inventoryapp/models.py"], "/health/inventorysite/inventoryapp/views.py": ["/health/inventorysite/inventoryapp/models.py"]}
44,755
yashinil/HappyHearts
refs/heads/master
/health/inventorysite/inventoryapp/models.py
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from django.utils import timezone # Create your models here. class Lender(models.Model): lender = models.CharField(max_length=200) image = models.FileField(null=True,blank=True) product_na...
{"/health/inventorysite/inventoryapp/admin.py": ["/health/inventorysite/inventoryapp/models.py"], "/health/inventorysite/inventoryapp/views.py": ["/health/inventorysite/inventoryapp/models.py"]}
44,768
gatournament/gat-games
refs/heads/master
/tests/game_engine/test_gat_json.py
# coding: utf-8 import tempfile import unittest from gat_games.game_engine.gat_json import * class Normal(object): def __init__(self): self.a = 1 class JSONTests(unittest.TestCase): def test_encode_object(self): encoded_object = encode_object(Normal()) self.assertEquals(encoded_obje...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,769
gatournament/gat-games
refs/heads/master
/tests/game_engine/test_engine.py
# coding: utf-8 import unittest from nose.tools import raises from gat_games.game_engine.engine import * class PlayerTests(unittest.TestCase): def test_default_name_is_the_class_name_with_the_id(self): player = Player() self.assertEquals(True, player.name.startswith('Player')) def test_custo...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,770
gatournament/gat-games
refs/heads/master
/tests/games/test_pokertexasholdem.py
# coding: utf-8 import unittest from nose.tools import raises from gat_games.games.poker_texasholdem import * class PokerTests(unittest.TestCase): def setUp(self): self.p1 = PokerPlayer() self.p2 = PokerPlayer() self.poker = Poker(1, [self.p1, self.p2]) def test_game_attributes(self)...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,771
gatournament/gat-games
refs/heads/master
/gat_games/games/truco_clean_deck.py
# coding: utf-8 from gat_games.games.truco import * class TrucoCleanDeckCard(TrucoCard): ranks = (Q, J, K, AS, 2, 3) class TrucoCleanDeckDeck(TrucoDeck): Card = TrucoCleanDeckCard class TrucoCleanDeckRound(TrucoRound): Deck = TrucoCleanDeckDeck class TrucoCleanDeck(Truco): Round = TrucoCleanDeck...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,772
gatournament/gat-games
refs/heads/master
/tests/games/test_truco.py
# coding: utf-8 import unittest from gat_games.game_engine.cardgame import * from gat_games.games.truco import * class TrucoPlayerTests(unittest.TestCase): def test_gat_player_must_be_serializable(self): result = json.dumps(TrucoPlayer(['python', 'x'])) self.assertEquals('{}', result) class Tr...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,773
gatournament/gat-games
refs/heads/master
/gat_games/games/__init__.py
# coding: utf-8 import sys if sys.version_info[0] == 2: from gat_games.games.truco import * from gat_games.games.truco_clean_deck import * else: from .truco import * from .truco_clean_deck import * SUPPORTED_GAMES = [Truco, TrucoCleanDeck]
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,774
gatournament/gat-games
refs/heads/master
/gat_games/games/poker_texasholdem.py
# coding: utf-8 from itertools import combinations import random from gat_games.game_engine.engine import * from gat_games.game_engine.cardgame import * class PokerPlayer(Player): def play(self, context, **kwargs): if kwargs.get('action', 'play') == 'x': self.blind_bet(context) def blind...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,775
gatournament/gat-games
refs/heads/master
/gat_games/__init__.py
# coding: utf-8 VERSION = '0.0.2'
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,776
gatournament/gat-games
refs/heads/master
/gat_games/game_engine/engine.py
# coding: utf-8 import logging import random import sys import six import gat_games.game_engine.gat_json as json class EndGame(Exception): pass class AlgorithmError(Exception): pass class AlgorithmInitializationError(AlgorithmError): pass class AlgorithmTimeoutError(AlgorithmError): pass class InvalidCommandError(Al...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,777
gatournament/gat-games
refs/heads/master
/tests/test_init.py
# coding: utf-8 import re import unittest class InitTests(unittest.TestCase): def test_version(self): from gat_games import VERSION print(re.match(r'\d[.]\d[.]\d', VERSION)) self.assertEquals(True, bool(re.match(r'\d[.]\d[.]\d', VERSION))) def test_game_import_shortcut(self): ...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,778
gatournament/gat-games
refs/heads/master
/gat_games/games/truco_gaucho.py
# coding: utf-8 from gat_games.game_engine.engine import * from gat_games.game_engine.cardgame import * # http://pt.wikipedia.org/wiki/Truco
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,779
gatournament/gat-games
refs/heads/master
/gat_games/games/truco.py
# coding: utf-8 import random from gat_games.game_engine.engine import * from gat_games.game_engine.cardgame import * # TODOs: # who wins start next round => must_start_new_cycle BUG? class TrucoPlayer(Player): def play(self, context, **kwargs): if kwargs.get('action', 'play') == 'accept_truco': ...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,780
gatournament/gat-games
refs/heads/master
/gat_games/game_engine/gat_json.py
try: import simplejson as json except ImportError: import json def encode_object(obj): if hasattr(obj, '__getstate__'): return obj.__getstate__ if hasattr(obj, '__dict__'): return obj.__dict__ return obj def dumps(obj, skipkeys=True, default=encode_object, **kwargs): return j...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,781
gatournament/gat-games
refs/heads/master
/tests/game_engine/test_cardgame.py
# coding: utf-8 import unittest from gat_games.game_engine.cardgame import * class CardTests(unittest.TestCase): def test_valid_card(self): card = Card(AS, SPADES) self.assertEquals(SPADES, card.suit) self.assertEquals(AS, card.rank) def test_card_validate_rank(self): try: ...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,782
gatournament/gat-games
refs/heads/master
/gat_games/games/hole.py
# https://github.com/paulocheque/python-cardgameengine/blob/master/cardgames/hole/__init__.py
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,783
gatournament/gat-games
refs/heads/master
/gat_games/games/chess.py
# coding: utf-8 import random from gat_games.game_engine.engine import * # http://en.wikipedia.org/wiki/Chess class ChessNativePlayer(Player): def play(self, context, **kwargs): pass class RandomChessPlayer(ChessNativePlayer): def play(self, context, **kwargs): option = random.randint(0, 1...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,784
gatournament/gat-games
refs/heads/master
/gat_games/games/__game_model__.py
# coding: utf-8 import random from gat_games.game_engine.engine import * from gat_games.game_engine.cardgame import * class XPlayer(Player): def play(self, context, **kwargs): pass class RandomXPlayer(XPlayer): def play(self, context, **kwargs): option = random.randint(0, 10) class XCard(...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,785
gatournament/gat-games
refs/heads/master
/gat_games/game_engine/cardgame.py
# coding: utf-8 from gat_games.game_engine.engine import * AS = 1 J = 11 Q = 12 K = 13 SPADES = 1 HEARTS = 2 DIAMONDS = 3 CLUBS = 4 class Card(object): ''' Override: suit_weights = {...} ranks = (...) ''' ranks = (AS, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K) suits = (SPADES, HEARTS, DIAMONDS, ...
{"/tests/game_engine/test_gat_json.py": ["/gat_games/game_engine/gat_json.py"], "/tests/game_engine/test_engine.py": ["/gat_games/game_engine/engine.py"], "/tests/games/test_pokertexasholdem.py": ["/gat_games/games/poker_texasholdem.py"], "/gat_games/games/truco_clean_deck.py": ["/gat_games/games/truco.py"], "/tests/ga...
44,816
alyson6918/tabuada_e_calculadora
refs/heads/main
/CLass_calculator.py
#criando classes class Calculadora: def __init__(self, valor1, valor2): self.a = valor1 self.b = valor2 def soma (self): return self.a + self.b def subtracao (self): return self.a - self.b def divisao (self): return self.a / self.b def multiplicacao (self): ...
{"/script.py": ["/CLass_calculator.py"]}
44,817
alyson6918/tabuada_e_calculadora
refs/heads/main
/script.py
#importação: from CLass_calculator import Calculadora #declarando variaveis: pergunta1 = "n" #estruturas de repetição: while pergunta1 == "nao" or pergunta1 == "n" or pergunta1 == "não": pergunta = "sim" tc = str(input("Você deseja calcular ou fazer uma tabuada ?\n(Escreva:tabuada ou calcular)\n.")) while...
{"/script.py": ["/CLass_calculator.py"]}
44,818
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/order/migrations/0003_auto_20160805_1916.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-05 23:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('order', '0002_orderdetail_item'), ] operations = [ migrations.AlterField( ...
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}
44,819
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/order/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-05 22:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('clients', '0001_initial'), ] op...
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}
44,820
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/order/admin.py
from django.contrib import admin from .models import * @admin.register(Order) class OrderAdmin(admin.ModelAdmin): list_display = ('client', 'date_order', 'status', 'amount_total', 'weight') @admin.register(OrderDetail) class OrderDetailAdmin(admin.ModelAdmin): list_display = ('order', 'item', 'qty', 'price') @admi...
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}
44,821
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/items/models.py
from __future__ import unicode_literals from django.db import models class Item(models.Model): description = models.CharField(max_length=255) brand = models.CharField(max_length=255) code = models.CharField(max_length=30) picture = models.ImageField(upload_to="media/items") price = models.DecimalField(max_digits...
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}
44,822
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/items/admin.py
from django.contrib import admin from .models import * @admin.register(Item) class ItemAdmin(admin.ModelAdmin): list_display = ('description', 'brand', 'code', 'picture', 'price', 'weight')
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}
44,823
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/order/models.py
from __future__ import unicode_literals from django.db import models from clients.models import Client from items.models import Item class Status(models.Model): state = models.CharField(max_length=30) def __unicode__(self): return self.state class Order(models.Model): client = models.ForeignKey(Client) date_or...
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}
44,824
elektrodx/omcor-beta-v01
refs/heads/master
/omcor/items/migrations/0002_auto_20160808_2134.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-09 01:34 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('items', '0001_initial'), ] operations = [ migrations.AlterField( ...
{"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]}