index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
62,880 | mrphlip/lrrbot | refs/heads/master | /lrrbot/command_parser.py | import asyncio
import logging
import irc.client
from common import utils
from common import command_parser
log = logging.getLogger('command_parser')
class CommandParser(command_parser.CommandParser):
def __init__(self, lrrbot, loop):
super().__init__(loop)
self.lrrbot = lrrbot
self.lrrbot.reactor.add_global... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,881 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/7d1d0f735480_state.py | revision = '7d1d0f735480'
down_revision = '1d631d605d27'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
from sqlalchemy.dialects import postgresql
def upgrade():
alembic.op.create_table('state',
sqlalchemy.Column('key', sqlalchemy.Text, primary_key=True),
sqlalchemy.Column('value', postg... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,882 | mrphlip/lrrbot | refs/heads/master | /lrrbot/commands/card.py | import sqlalchemy
import lrrbot.decorators
from lrrbot.main import bot
import common.postgres
import common.time
from common.card import clean_text, CARD_GAME_MTG, CARD_GAME_KEYFORGE, CARD_GAME_PTCG
@bot.command("cardview (on|off)")
@lrrbot.decorators.mod_only
def set_cardview(lrrbot, conn, event, respond_to, setting... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,883 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/286bd48821dd_rename_users_patreon_user.py | revision = '286bd48821dd'
down_revision = '0dec7733925d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.alter_column('users', 'patreon_user', new_column_name="patreon_user_id")
def downgrade():
alembic.op.alter_column('users', 'patreon_user_id', new_column_name="p... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,884 | mrphlip/lrrbot | refs/heads/master | /lrrbot/systemd.py | import logging
import os
import ctypes
import ctypes.util
log = logging.getLogger("lrrbot.systemd")
try:
libsystemd = ctypes.CDLL(ctypes.util.find_library("systemd"))
libsystemd.sd_notify.argtypes = [ctypes.c_int, ctypes.c_char_p]
def notify(status):
libsystemd.sd_notify(0, status.encode('utf-8'))
except OSErr... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,885 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/cddcdf06d9f9_storm.py | revision = 'cddcdf06d9f9'
down_revision = '6f1e9151ef83'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
import logging
import datetime
import json
def upgrade():
storm = alembic.op.create_table("storm",
sqlalchemy.Column("date", sqlalchemy.Date, primary_key=True),
sqlalchemy.Column("twit... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,886 | mrphlip/lrrbot | refs/heads/master | /common/game_data.py | import sqlalchemy
TABLES = [
"game_per_show_data",
"games",
"quotes",
]
def lock_tables(conn, metadata):
" Lock all tables that reference the `games` table "
conn.execute(sqlalchemy.text("LOCK TABLE " + ", ".join(TABLES) + " IN ACCESS EXCLUSIVE MODE"))
def merge_games(conn, metadata, old_id, new_id, result_id):... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,887 | mrphlip/lrrbot | refs/heads/master | /lrrbot/linkspam.py | import aiomas
import asyncio
import logging
import common.url
import common.spam
from common import utils
from lrrbot import storage
import irc.client
log = logging.getLogger('linkspam')
class LinkSpam:
router = aiomas.rpc.Service()
def __init__(self, lrrbot, loop):
self.loop = loop
self.lrrbot = lrrbot
sel... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,888 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/77dc71b483ed_users_foreign_keys.py | revision = '77dc71b483ed'
down_revision = 'a6854cd2e5f1'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
import urllib.parse
import requests
import logging
log = logging.getLogger("77dc71b483ed_users_foreign_keys")
# People who know a guy at Twitch
RENAMES = {
'a169': 'anubis169',
'dixonij'... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,889 | mrphlip/lrrbot | refs/heads/master | /scrape_multiverse.py | #!/usr/bin/env python3
import sys
import json
import csv
import regex # not re, because we need .captures()
def get_data(filename):
with open(filename, newline='') as fp:
for row in csv.DictReader(fp):
# Fix some inconsistent casing
if 'Supertype' in row:
row['SuperType'] = row.pop('Supertype')
if 'Su... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,890 | mrphlip/lrrbot | refs/heads/master | /www/quotes.py | import flask
import sqlalchemy
import www.utils
from www import server
from www import login
import common.postgres
QUOTES_PER_PAGE = 25
@server.app.route('/quotes/')
@server.app.route('/quotes/<int:page>')
@login.with_session
def quotes(session, page=1):
quotes = server.db.metadata.tables["quotes"]
games = server... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,891 | mrphlip/lrrbot | refs/heads/master | /lrrbot/rpc.py | import aiomas
import random
import logging
import sqlalchemy
import common.utils
import common.rpc
from common import utils
from common.config import config
from common import twitch
from lrrbot import storage
import lrrbot.docstring
log = logging.getLogger('serverevents')
class Server(common.rpc.Server):
router =... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,892 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/d88d63c07199_.py | revision = 'd88d63c07199'
down_revision = ('6387fbb406f3', '77dc71b483ed')
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
pass
def downgrade():
pass
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,893 | mrphlip/lrrbot | refs/heads/master | /lrrbot/commands/patreon.py | from common.config import config
from common import patreon
from lrrbot.main import bot
import lrrbot.decorators
@bot.command("patreon")
@lrrbot.decorators.throttle()
async def get_patreon_info(lrrbot, conn, event, respond_to):
"""
Command: !patreon
Section: info
Post the Patreon total.
"""
token = await patre... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,894 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/5aa73ff113c3_event_name_field.py | revision = '5aa73ff113c3'
down_revision = 'cddcdf06d9f9'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.execute("""
UPDATE events
SET data = JSONB_SET(data, '{name}', COALESCE(data->'twitch'->'name', data->'patreon'->'full_name'))
WHERE event = 'patreon-pled... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,895 | mrphlip/lrrbot | refs/heads/master | /lrrbot/commands/show.py | import sqlalchemy
import lrrbot.decorators
from lrrbot.main import bot
def set_show(lrrbot, show):
lrrbot.set_show(show.lower())
lrrbot.get_game_id.reset_throttle()
@bot.command("show")
@lrrbot.decorators.throttle()
def get_show(lrrbot, conn, event, respond_to):
"""
Command: !show
Section: info
Post the curre... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,896 | mrphlip/lrrbot | refs/heads/master | /lrrbot/join_filter.py | import time
import irc.client
from common.config import config
TIMEOUT = 90
class JoinFilter:
def __init__(self, lrrbot, loop):
self.loop = loop
self.lrrbot = lrrbot
self.bot_start = None
self.last_parts = {}
self.lrrbot.reactor.add_global_handler('join', self.filter_joins, 20)
self.lrrbot.reactor.ad... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,897 | mrphlip/lrrbot | refs/heads/master | /www/utils.py | import os
import datetime
import subprocess
import flask
import pytz
import jinja2.utils
from common import config
from common.utils import cache
from common.time import nice_duration
from www import login
def error_page(message):
return flask.render_template("error.html", message=message, session=login.load_sessio... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,898 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/954c3c4caf32_.py | revision = '954c3c4caf32'
down_revision = ('695afc7a0e54', 'f2ecbd726b58')
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
pass
def downgrade():
pass
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,899 | mrphlip/lrrbot | refs/heads/master | /lrrbot/commands/__init__.py | import lrrbot.commands.card
import lrrbot.commands.game
import lrrbot.commands.lockdown
import lrrbot.commands.misc
import lrrbot.commands.patreon
import lrrbot.commands.show
import lrrbot.commands.static
import lrrbot.commands.strawpoll
import lrrbot.commands.quote
import lrrbot.commands.live
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,900 | mrphlip/lrrbot | refs/heads/master | /www/clips.py | import flask
import sqlalchemy
from sqlalchemy.dialects.postgresql import insert
from collections import defaultdict
from www import server
from www import login
from www.archive import archive_feed_data, get_video_data
from common.config import config
from common.time import nice_duration
from common.twitch import get... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,901 | mrphlip/lrrbot | refs/heads/master | /lrrbot/cardviewer.py | import asyncio
import aiomas
import logging
import sqlalchemy
from common import utils
from common.config import config
__all__ = ["CardViewer"]
REPEAT_TIMER = 120
ANNOUNCE_DELAY = 5
log = logging.getLogger('cardviewer')
class CardViewer:
router = aiomas.rpc.Service()
def __init__(self, lrrbot, loop):
self.lr... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,902 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/d24b55f6f078_add_message_id_to_chat_log.py | revision = 'd24b55f6f078'
down_revision = '291f6bc486eb'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
from sqlalchemy.dialects.postgresql import UUID
def upgrade():
alembic.op.add_column('log',
sqlalchemy.Column('msgid', UUID, nullable=True)
)
alembic.op.create_index("log_msgid", "log"... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,903 | mrphlip/lrrbot | refs/heads/master | /common/googlecalendar.py | import datetime
import json
import urllib.parse
import textwrap
import string
import re
import dateutil.parser
import pytz
import pytz.exceptions
from html2text import html2text
import common.http
import common.time
from common import gdata
from common import utils
from common.config import config
from common import ... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,904 | mrphlip/lrrbot | refs/heads/master | /build_carddb_mtg.py | #!/usr/bin/env python3
"""
This script downloads the latest MTG card data from http://mtgjson.com/ and processes
it to turn the highly-structured data there into a flat list of card names to descriptions
formatted to send down the chat.
"""
import common
common.FRAMEWORK_ONLY = True
import sys
import os
import urllib.... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,905 | mrphlip/lrrbot | refs/heads/master | /common/postgres.py | import warnings
import sqlalchemy
from common.config import config
def new_engine_and_metadata():
"""
Create new SQLAlchemy engine and metadata.
NOTE: Every process should have AT MOST one engine.
"""
engine = sqlalchemy.create_engine(config["postgres"], echo=config["debugsql"], execution_options={"autocommit"... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,906 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/85037b8270b2_add_clips_table.py | revision = '85037b8270b2'
down_revision = '10250cd94386'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
from sqlalchemy.dialects import postgresql
def upgrade():
clips = alembic.op.create_table("clips",
sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True, autoincrement=True),
sq... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,907 | mrphlip/lrrbot | refs/heads/master | /www/spam.py | import asyncio
import datetime
import flask
import flask.json
import pytz
import re
import sqlalchemy
import common.url
import common.rpc
import common.spam
from www import server
from www import login
from www import history
@server.app.route('/spam')
@login.require_mod
async def spam(session):
link_spam = "link_sp... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,908 | mrphlip/lrrbot | refs/heads/master | /common/storm.py | import datetime
import sqlalchemy
from sqlalchemy.dialects.postgresql import insert
from common.config import config
def increment(engine, metadata, counter, by=1):
storm = metadata.tables['storm']
with engine.connect() as conn:
query = insert(storm).returning(storm.c[counter])
query = query.on_conflict_do_upda... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,909 | mrphlip/lrrbot | refs/heads/master | /lrrbot/commands/static.py | import aiomas
import random
import re
import irc.client
import lrrbot.decorators
from common.config import config
from lrrbot import storage
from lrrbot.main import bot, log
def generate_docstring():
inverse_responses = {}
for command, data in storage.data["responses"].items():
response = data["response"]
if is... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,910 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/7c9bbf3a039a_game_stats_stat_id.py | revision = '7c9bbf3a039a'
down_revision = '89c5cb66426d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
conn = alembic.context.get_context().bind
meta = sqlalchemy.MetaData(bind=conn)
meta.reflect()
game_stats = meta.tables["game_stats"]
shows = meta.tables["shows"]
cons... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,911 | mrphlip/lrrbot | refs/heads/master | /start_bot.py | #!/usr/bin/env python3
import logging
from common import utils
utils.init_logging("lrrbot")
from lrrbot.main import bot, log
import lrrbot.commands
try:
log.info("Bot startup")
bot.start()
except (KeyboardInterrupt, SystemExit):
pass
finally:
log.info("Bot shutdown")
logging.shutdown()
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,912 | mrphlip/lrrbot | refs/heads/master | /lrrbot/decorators.py | import enum
import functools
import logging
import time
import irc.client
from common.utils import coro_decorator, throttle_base, DEFAULT_THROTTLE
from lrrbot.docstring import encode_docstring, add_header, parse_docstring
from common import twitch
log = logging.getLogger("lrrbot.decorators")
@coro_decorator
def mod... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,913 | mrphlip/lrrbot | refs/heads/master | /common/pubsub.py | import aiohttp
import asyncio
import blinker
import uuid
import logging
import sqlalchemy
import json
import random
from common import http
from common import utils
from common.config import config
__all__ = ["PubSub", "signals"]
signals = blinker.Namespace()
log = logging.getLogger('common.pubsub')
class Topic:
d... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,914 | mrphlip/lrrbot | refs/heads/master | /common/time.py | import datetime
import re
import timelib
import pytz
from common import config
def nice_duration(s, detail=1):
"""
Convert a duration in seconds to a human-readable duration.
detail can be:
0 - Always show to the nearest second
1 - Show to the nearest minute, unless less than a minute
2 - Show to the neare... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,915 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/fbef4c1a84db_add_rater_column_to_clips.py | revision = 'fbef4c1a84db'
down_revision = '72a56f6f1148'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.add_column('clips',
sqlalchemy.Column('rater', sqlalchemy.Integer, sqlalchemy.ForeignKey("users.id", onupdate="CASCADE", ondelete="SET NULL"))
)
def downgrade... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,916 | mrphlip/lrrbot | refs/heads/master | /lrrbot/twitchcheer.py | import asyncio
import common.rpc
import common.storm
from common import utils
from lrrbot import chatlog
import logging
log = logging.getLogger('cheer')
class TwitchCheer:
LEVELS = [(10000, 'red'), (5000, 'blue'), (1000, 'green'), (100, 'purple'), (1, 'gray')]
def __init__(self, lrrbot, loop):
self.loop = loop
... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,917 | mrphlip/lrrbot | refs/heads/master | /rebuild_chat_logs.py | #!/usr/bin/env python3
import common
common.FRAMEWORK_ONLY = True
from lrrbot.chatlog import run_task, rebuild_all, stop_task
import asyncio
loop = asyncio.new_event_loop()
task = asyncio.ensure_future(run_task(), loop=loop)
rebuild_all()
stop_task()
loop.run_until_complete(task)
loop.close()
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,918 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/10250cd94386_add_hidden_flag_for_cards.py | revision = '10250cd94386'
down_revision = '0e33b11b0930'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.add_column('cards',
sqlalchemy.Column('hidden', sqlalchemy.Boolean, nullable=False, server_default='false')
)
def downgrade():
alembic.op.drop_column('cards'... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,919 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/72a56f6f1148_fix_foreign_key_cascades.py | revision = '72a56f6f1148'
down_revision = 'be28e555a2da'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
# Remove cascading deletes from quote FKs
alembic.op.drop_constraint("quotes_game_id_fkey", "quotes", "foreignkey")
alembic.op.drop_constraint("quotes_show_id_fkey", "quot... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,920 | mrphlip/lrrbot | refs/heads/master | /scrape_sheets.py | #!/usr/bin/env python3
import sys
sys.argv, args = sys.argv[:1], sys.argv[1:]
from common import gdata, http
import asyncio
import argparse
import json
def getargs():
parser = argparse.ArgumentParser(description="Scrape card spoilers from Google Sheets")
parser.add_argument('sheetid', type=str, help="Sheet ID for th... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,921 | mrphlip/lrrbot | refs/heads/master | /find_clips.py | #!/usr/bin/env python3
import sys
argv = sys.argv[1:]
sys.argv = sys.argv[:1]
import argparse
import json
import datetime
import dateutil.parser
import pytz
import common.http
import common.postgres
from common.config import config
from common.twitch import get_user, get_token
import sqlalchemy
from sqlalchemy.dialect... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,922 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/643aab2ac6ed_add_team_battle_to_storm.py | revision = '643aab2ac6ed'
down_revision = 'f63e1a13dfe5'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.add_column('storm',
sqlalchemy.Column('team-james', sqlalchemy.Integer, nullable=False, server_default='0')
)
alembic.op.add_column('storm',
sqlalchemy.Colu... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,923 | mrphlip/lrrbot | refs/heads/master | /lrrbot/whisper.py | import logging
import asyncio
from common import twitch
from common import utils
log = logging.getLogger('whisper')
class TwitchWhisper:
def __init__(self, lrrbot, loop):
self.lrrbot = lrrbot
self.loop = loop
self.message_queue = asyncio.Queue()
self.message_pump_task = asyncio.ensure_future(self.message_pu... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,924 | mrphlip/lrrbot | refs/heads/master | /www/patreon.py | import base64
import dateutil.parser
import flask
import hmac
import os
import sqlalchemy
from sqlalchemy.dialects.postgresql import insert
import urllib.parse
from www import server
from www import login
from common.config import config
from common import patreon
import common.rpc
PATREON_BASE_URL = "https://www.patr... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,925 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/291f6bc486eb_external_vods_in_database.py | revision = '291f6bc486eb'
down_revision = '71efde332866'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
external_channel = alembic.op.create_table("external_channel",
sqlalchemy.Column("id", sqlalchemy.Integer, primary_key=True, autoincrement=True),
sqlalchemy.Column("chan... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,926 | mrphlip/lrrbot | refs/heads/master | /lrrbot/commands/misc.py | import asyncio
import datetime
import json
import logging
import random
import dateutil.parser
import pytz
import irc.client
import sqlalchemy
import common.http
import common.time
import common.storm
import lrrbot.decorators
from common import googlecalendar
from common import utils
from common.config import config
... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,927 | mrphlip/lrrbot | refs/heads/master | /www/prefs.py | import flask
from www import server
from www import login
@server.app.route('/prefs')
@login.require_login
def prefs(session):
return flask.render_template('prefs.html', session=session, saved=False)
@server.app.route('/prefs', methods=["POST"])
@login.require_login
def prefs_save(session):
if 'autostatus' in flask... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,928 | mrphlip/lrrbot | refs/heads/master | /lrrbot/desertbus_moderator_actions.py | """
This module has basically nothing to do with actual lrrbot functionality...
It's just piggy-backing off it to share its code and steal its event loop.
Because that's easier than making this a separate process.
"""
import asyncio
import datetime
import sqlalchemy
from common import pubsub
from common import utils... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,929 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/ee81e255ddc0_drop_cards_lastprinted.py | revision = 'ee81e255ddc0'
down_revision = 'dd3efe83691d'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.drop_column('cards', 'lastprinted')
def downgrade():
alembic.op.add_column('cards', sqlalchemy.Column("lastprinted", sqlalchemy.Date))
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,930 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/1d631d605d27_fix_clip_json.py | revision = '1d631d605d27'
down_revision = '3b866be530cb'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
import json
def upgrade():
conn = alembic.context.get_context().bind
meta = sqlalchemy.MetaData(bind=conn)
meta.reflect()
clips = meta.tables["clips"]
for clipid, clipjson in conn.exe... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,931 | mrphlip/lrrbot | refs/heads/master | /common/http.py | import asyncio
import atexit
import gc
import json
import logging
import urllib.parse
import urllib.request
import aiohttp
import async_timeout
from common import config
from common import utils
log = logging.getLogger("common.http")
USER_AGENT = "LRRbot/2.0 (https://lrrbot.com/)"
class Request(urllib.request.Requ... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,932 | mrphlip/lrrbot | refs/heads/master | /www/index.py | import flask
from www import server
from www import login
@server.app.route('/')
@login.with_session
def index(session):
return flask.render_template('index.html', session=session)
@server.app.route('/favicon.ico')
def favicon():
return server.app.send_static_file("favicon.ico")
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,933 | mrphlip/lrrbot | refs/heads/master | /common/__init__.py | # scripts can set this to True before lrrbot.main is imported, if they want to
# be able to call utility functions without actually creating the bot object
FRAMEWORK_ONLY = False
| {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,934 | mrphlip/lrrbot | refs/heads/master | /lrrbot/stream_status.py | import asyncio
import logging
from common import twitch
from common import rpc
from common import utils
log = logging.getLogger(__name__)
class StreamStatus:
def __init__(self, lrrbot, loop):
self.lrrbot = lrrbot
self.loop = loop
self.handle = None
self.was_live = bool(twitch.is_stream_live())
self.sched... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,935 | mrphlip/lrrbot | refs/heads/master | /build_carddb_ptcg.py | #!/usr/bin/env python3
"""
This script downloads the latest PTCG card data from http://pokemontcg.io/ and processes
it to turn the highly-structured data there into a flat list of card names to descriptions
formatted to send down the chat.
"""
import common
common.FRAMEWORK_ONLY = True
import urllib.request
import url... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,936 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/e966a3afd100_separate_patreon_user_table.py | revision = 'e966a3afd100'
down_revision = '954c3c4caf32'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
import requests
import pytz
import dateutil.parser
import datetime
def upgrade():
patreon_users = alembic.op.create_table("patreon_users",
sqlalchemy.Column("id", sqlalchemy.Integer, pri... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,937 | mrphlip/lrrbot | refs/heads/master | /common/config.py | import configparser
import pytz
from common.commandline import argv
CONFIG_SECTION = 'lrrbot'
config = configparser.ConfigParser()
config.read(argv.conf)
apipass = dict(config.items("apipass"))
from_apipass = {p: u for u, p in apipass.items()}
config = dict(config.items(CONFIG_SECTION))
# hostname - server to co... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,938 | mrphlip/lrrbot | refs/heads/master | /alembic/versions/0e33b11b0930_drop_patreon_users_last_announce_month.py | revision = '0e33b11b0930'
down_revision = '286bd48821dd'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
def upgrade():
alembic.op.drop_column('patreon_users', 'last_announce_month')
def downgrade():
alembic.op.add_column('patreon_users', sqlalchemy.Column("last_announce_month", sqlalchemy.... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,939 | mrphlip/lrrbot | refs/heads/master | /alembic/env.py | from __future__ import with_statement
from alembic import context
import sqlalchemy
import logging
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s")
target_metadata = None
def run_migrations_offline():
"""Run migrations in 'offline' mode.
This configures the contex... | {"/lrrbot/commands/live.py": ["/lrrbot/decorators.py", "/lrrbot/main.py", "/common/__init__.py"], "/common/url.py": ["/common/http.py", "/common/__init__.py"], "/common/twitch.py": ["/common/http.py", "/common/__init__.py", "/common/config.py"], "/www/api_v2.py": ["/common/__init__.py", "/common/rpc.py", "/common/storm... |
62,940 | eugenekk/django | refs/heads/master | /myproject/blog/views.py | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
# blog App 에서 구현할 서비스를 작성합니다.
def index(request):
return HttpResponse("Hello World")
def test2(request, id):
print(type(id))
return HttpResponse(id)
| {"/myproject/article/admin.py": ["/myproject/article/models.py"], "/myproject/article/views.py": ["/myproject/article/models.py"], "/myproject/blog/views.py": ["/myproject/blog/models.py"], "/myproject/book/views.py": ["/myproject/book/models.py", "/myproject/book/forms.py"], "/myproject/blog/admin.py": ["/myproject/bl... |
62,941 | eugenekk/django | refs/heads/master | /myproject/blog/urls.py | from django.urls import path, include, register_converter
from . import views
from .converters import CodeConverter
register_converter(CodeConverter, 'dddd')
urlpatterns = [
path('test/', views.index),
path('test2/<dddd:id>', views.test2), # id라는 인자를 받아서 씀
]
| {"/myproject/article/admin.py": ["/myproject/article/models.py"], "/myproject/article/views.py": ["/myproject/article/models.py"], "/myproject/blog/views.py": ["/myproject/blog/models.py"], "/myproject/book/views.py": ["/myproject/book/models.py", "/myproject/book/forms.py"], "/myproject/blog/admin.py": ["/myproject/bl... |
62,947 | albertqjiang/Video-Streaming | refs/heads/master | /latency.py | def calculate_latency(cache_server_info, endpoint_connections, endpoint_datacenter_latency,
endpoint_cache_latencies, requests):
total_latency = 0
total_requests = 0
original_latency = 0
for request in requests:
print(request)
how_many_requests = request[2]
request_endpoint = request[1]
request_video... | {"/main2.py": ["/inout.py", "/validation.py", "/latency.py"], "/validation.py": ["/inout.py"], "/main.py": ["/inout.py", "/validation.py", "/latency.py"], "/latency_test.py": ["/latency.py"]} |
62,948 | albertqjiang/Video-Streaming | refs/heads/master | /main2.py | from inout import *
from validation import validate
from latency import calculate_latency
data_config, video_config, endpoints, endpoint_connections, endpoint_datacenter_latency, requests = load_data("trending_today.in")
# print(data_config["caches"])
best_result = 0
best_methods = list()
for i in range(0, 2):
cache... | {"/main2.py": ["/inout.py", "/validation.py", "/latency.py"], "/validation.py": ["/inout.py"], "/main.py": ["/inout.py", "/validation.py", "/latency.py"], "/latency_test.py": ["/latency.py"]} |
62,949 | albertqjiang/Video-Streaming | refs/heads/master | /validation.py | from inout import load_data
import numpy as np
# cache_storage is a list of caches with already stored data
# video_size is a list of videos with their sizes in MB
# new_storing_command is a tuple of (video_id, cache_id)
def validate(cache_storage, video_size, new_storing_command, data_config, video_config, endpoints... | {"/main2.py": ["/inout.py", "/validation.py", "/latency.py"], "/validation.py": ["/inout.py"], "/main.py": ["/inout.py", "/validation.py", "/latency.py"], "/latency_test.py": ["/latency.py"]} |
62,950 | albertqjiang/Video-Streaming | refs/heads/master | /main.py | from inout import *
from validation import validate
from latency import calculate_latency
filename = "trending_today.in"
data_config, video_config, endpoints, endpoint_connections, endpoint_datacenter_latency, requests = load_data(filename)
# print(data_config["caches"])
best_result = 0
best_methods = list()
for i i... | {"/main2.py": ["/inout.py", "/validation.py", "/latency.py"], "/validation.py": ["/inout.py"], "/main.py": ["/inout.py", "/validation.py", "/latency.py"], "/latency_test.py": ["/latency.py"]} |
62,951 | albertqjiang/Video-Streaming | refs/heads/master | /inout.py | """ Module for loading and outputting data """
def load_data(filename):
"""
Data returned: data_config, video_config, endpoints, endpoint_connections, endpoint_datacentre_latency, requests
each endpoint is dictionary with the cache_id being the key and the latency being the value,
the ... | {"/main2.py": ["/inout.py", "/validation.py", "/latency.py"], "/validation.py": ["/inout.py"], "/main.py": ["/inout.py", "/validation.py", "/latency.py"], "/latency_test.py": ["/latency.py"]} |
62,952 | albertqjiang/Video-Streaming | refs/heads/master | /latency_test.py | from latency import calculate_latency
cache_server_info = [[2], [3, 1], [0, 1]]
endpoint_connections = [[0, 2, 1], []]
endpoint_datacenter_latency = [1000, 500]
endpoint_cache_latencies = [{0:100, 2:200, 1:300}, {} ]
requests = [[3, 0, 1500], [0, 1, 1000], [4, 0, 500], [1, 0, 1000]]
print(calculate_latency(cache_serv... | {"/main2.py": ["/inout.py", "/validation.py", "/latency.py"], "/validation.py": ["/inout.py"], "/main.py": ["/inout.py", "/validation.py", "/latency.py"], "/latency_test.py": ["/latency.py"]} |
63,056 | pchmn/danzeenldc | refs/heads/master | /articles/templatetags/articles_tags.py | from django import template
register = template.Library()
# @register.inclusion_tag('articles/create_comment.html', name="create_comment_form", takes_context=True)
# def create_comment_form(context, id):
# """
# Commenter un article
#
# L'utilisateur doit entrer un pseudo s'il n'est pas connecté
# """... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,057 | pchmn/danzeenldc | refs/heads/master | /accounts/forms.py | import collections
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, PasswordChangeForm
class CreateUserForm(UserCreationForm):
error_messages = {
'password_mismatch': "Les deux mot de passes sont différents",
}
password1... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,058 | pchmn/danzeenldc | refs/heads/master | /articles/models.py | from django.core.validators import MaxLengthValidator
from django.db import models
from django.contrib.auth.models import User
from articles.utils import unique_slugify
class Article(models.Model):
"""
Classe qui représente un article
Chaque article est lié à un utilisateur qui en est l'auteur
"""
... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,059 | pchmn/danzeenldc | refs/heads/master | /articles/urls.py | from django.conf.urls import url
from . import views
from . import ajax
urlpatterns = [
url(r'^create_article$', views.create_article, name="create_article"),
url(r'^$', views.get_articles, name="get_articles"),
url(r'^(?P<page>\d+)', views.get_articles, name="get_articles"),
url(r'^article/(?P<slug>[\... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,060 | pchmn/danzeenldc | refs/heads/master | /accounts/views.py | from django.contrib import messages
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect
from django.contrib.auth.models import User
from django.views.generic.edit import CreateView
from accounts.forms import CreateUserForm, LoginFo... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,061 | pchmn/danzeenldc | refs/heads/master | /accounts/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^create_user$', views.CreateUser.as_view(), name="create_user"),
url(r'^login', views.login_user, name="login"),
url(r'^logout$', views.logout_user, name="logout"),
url(r'^profile/(?P<username>.*)$', views.get_profile, name="get... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,062 | pchmn/danzeenldc | refs/heads/master | /accounts/models.py | from django.db import models
from django.contrib.auth.models import User
from django.dispatch import receiver
from jsonfield import JSONField
from django.db.models.signals import post_save
class UserProfile(models.Model):
"""
Classe qui représente des informations supplémentaires
pour un utilisateur
... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,063 | pchmn/danzeenldc | refs/heads/master | /articles/ajax.py | from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from articles.models import Article, Commentaire
def vote_article(request, id_article):
"""
Voter pour un article
Lors du vote, un cookie est placé pour éviter qu'un même personne
puisse voter plusieurs fois.
Ava... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,064 | pchmn/danzeenldc | refs/heads/master | /articles/views.py | import json
import os
from datetime import datetime, timedelta
import collections
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import PermissionDenied
from django.shortcuts import ... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,065 | pchmn/danzeenldc | refs/heads/master | /articles/forms.py | from django import forms
from articles.models import Article, Commentaire
from django.contrib.auth.models import User
from articles.utils import bleach_html
class CreateArticleForm(forms.ModelForm):
title = forms.CharField(error_messages={'required': "Votre titre est vide"})
intro = forms.CharField(error_mess... | {"/accounts/views.py": ["/accounts/forms.py"], "/articles/ajax.py": ["/articles/models.py"], "/articles/views.py": ["/articles/models.py", "/articles/forms.py"], "/articles/forms.py": ["/articles/models.py"]} |
63,067 | pinkoceann/FrMLNet | refs/heads/main | /network.py | from modelUtil import *
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
import numpy as np
class FrMLNet(nn.Module):
def __init__(self,ms_channels=4, fc = 64, rbc = 2):
super(FrMLNet,self).__init__()
self.ms_channel... | {"/network.py": ["/modelUtil.py"], "/train_QB.py": ["/network.py", "/util.py", "/dataset.py"], "/test_QB.py": ["/network.py", "/util.py", "/dataset.py"]} |
63,068 | pinkoceann/FrMLNet | refs/heads/main | /train_QB.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
# This is a implementation of training code of this paper:
# FrMLNet: Framelet-based Multi-level Network for Pansharpening
# author: Tingting Wang
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch... | {"/network.py": ["/modelUtil.py"], "/train_QB.py": ["/network.py", "/util.py", "/dataset.py"], "/test_QB.py": ["/network.py", "/util.py", "/dataset.py"]} |
63,069 | pinkoceann/FrMLNet | refs/heads/main | /dataset.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import h5py
import torch.utils.data as data
import numpy as np
import torch
import torch.nn as nn
class my_dataset(data.Dataset):
def __init__(self,mat_data):
gt_set = mat_data['gt'][...]
gt_set = np.transpose(gt_set,(3,0,1,2))
pan_set = mat_d... | {"/network.py": ["/modelUtil.py"], "/train_QB.py": ["/network.py", "/util.py", "/dataset.py"], "/test_QB.py": ["/network.py", "/util.py", "/dataset.py"]} |
63,070 | pinkoceann/FrMLNet | refs/heads/main | /test_QB.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
# This is a implementation of validation code of this paper:
# FrMLNet: Framelet-based Multi-level Network for Pansharpening
# author: Tingting Wang
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import tor... | {"/network.py": ["/modelUtil.py"], "/train_QB.py": ["/network.py", "/util.py", "/dataset.py"], "/test_QB.py": ["/network.py", "/util.py", "/dataset.py"]} |
63,071 | pinkoceann/FrMLNet | refs/heads/main | /modelUtil.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
# --- Residual block in GridDehazeNet --- #
class Residual_Block(nn.Module):
def __init__(self, inc = 64, outc = 64, ks =3, groups=1, dilation=1):
super(Residual_Block, self).__init_... | {"/network.py": ["/modelUtil.py"], "/train_QB.py": ["/network.py", "/util.py", "/dataset.py"], "/test_QB.py": ["/network.py", "/util.py", "/dataset.py"]} |
63,072 | pinkoceann/FrMLNet | refs/heads/main | /util.py | import numpy as np
from numpy import linalg as LA
import os
import cv2
import torch.nn as nn
import math
import pickle
import torch
from numpy import *
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
def SAM(I1,I2):
p1 = np.sum(I1*I2,0)
p2 = np.sum(I1*I1,0)
p3 = np.su... | {"/network.py": ["/modelUtil.py"], "/train_QB.py": ["/network.py", "/util.py", "/dataset.py"], "/test_QB.py": ["/network.py", "/util.py", "/dataset.py"]} |
63,075 | rrichard-gcps/r-bridge-install | refs/heads/master | /rtools/update_package.py | # Py3 compat layer
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import arcpy
import sys
from .github_release import release_info
from .install_package import install_package
from .rpath import r_library_path, r_pkg_version
from .utils import vers... | {"/rtools/update_package.py": ["/rtools/install_package.py"]} |
63,076 | rrichard-gcps/r-bridge-install | refs/heads/master | /rtools/install_package.py | # Py3 compat layer
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import arcpy
try:
import ctypes
except ImportError:
msg = "Unable to connect to your Windows configuration, " + \
"this is likely due to an incorrect Python installa... | {"/rtools/update_package.py": ["/rtools/install_package.py"]} |
63,104 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0019_teacher.py | # Generated by Django 2.1.5 on 2019-02-01 08:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service20', '0018_auto_20190201_0847'),
]
operations = [
migrations.CreateModel(
name='teacher',
fields=[
... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,105 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0036_auto_20190212_2134.py | # Generated by Django 2.1.5 on 2019-02-12 21:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('service20', '0035_auto_20190212_1345'),
]
operations = [
migrations.AlterField(
model_name='com... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,106 | ohsehwan/django_admin_nanum | refs/heads/master | /post/models.py | from django.db import models
from member.models import Member
class Category(models.Model):
class Meta:
verbose_name_plural = 'Categories'
name = models.CharField('카테고리 이름', max_length=20)
def __str__(self):
return self.name
class Post(models.Model):
member = models.ForeignKey(Memb... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,107 | ohsehwan/django_admin_nanum | refs/heads/master | /api/urls.py | from django.urls import path
from api.views import MoimListView
app_name = 'api'
urlpatterns = [
path('moim/', MoimListView.as_view(), name='moim'),
] | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,108 | ohsehwan/django_admin_nanum | refs/heads/master | /service10/views.py | from django.shortcuts import render
from rest_framework import generics, serializers
from django.views.decorators.csrf import csrf_protect,csrf_exempt
from django.http import HttpResponse,Http404, HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404,render
from rest_framework.response impor... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,109 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0012_mpgm.py | # Generated by Django 2.1.5 on 2019-02-01 07:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service20', '0011_auto_20190201_0659'),
]
operations = [
migrations.CreateModel(
name='mpgm',
fields=[
... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,110 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0013_mentee.py | # Generated by Django 2.1.5 on 2019-02-01 07:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service20', '0012_mpgm'),
]
operations = [
migrations.CreateModel(
name='mentee',
fields=[
('mnte_id... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,111 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0023_mpgm_img_src.py | # Generated by Django 2.1.5 on 2019-02-08 09:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service20', '0022_auto_20190208_0837'),
]
operations = [
migrations.AddField(
model_name='mpgm',
name='img_src',
... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,112 | ohsehwan/django_admin_nanum | refs/heads/master | /post/filters.py | import datetime
from django.contrib import admin
from post.models import Post
class CreatedDateFilter(admin.SimpleListFilter):
title = '작성일'
parameter_name = 'date'
def lookups(self, request, model_admin):
result = []
for i in range(-3, 6):
date = datetime.date.today() + date... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,113 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0003_auto_20190131_2021.py | # Generated by Django 2.1.5 on 2019-01-31 20:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('service20', '0002_msch_img_src'),
]
operations = [
migrations.AlterField(
model_name='ms_apl',
... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,114 | ohsehwan/django_admin_nanum | refs/heads/master | /mogae/models.py | from django.db import models
from django.utils import timezone
# Create your models here.
class Moim(models.Model):
author = models.ForeignKey('auth.User',on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = models.TextField()
date = models.DateTimeField()
thumbnail = models.I... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,115 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/migrations/0008_mentor.py | # Generated by Django 2.1.5 on 2019-02-01 05:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service20', '0007_auto_20190201_0038'),
]
operations = [
migrations.CreateModel(
name='mentor',
fields=[
... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,116 | ohsehwan/django_admin_nanum | refs/heads/master | /mogae/apps.py | from django.apps import AppConfig
class MogaeConfig(AppConfig):
name = 'mogae'
| {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
63,117 | ohsehwan/django_admin_nanum | refs/heads/master | /service20/views2.py | from django.shortcuts import render
from rest_framework import generics, serializers
from django.http import HttpResponse,Http404, HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect,csrf_exempt
from django.shortcuts import get_object_or_404,re... | {"/post/models.py": ["/member/models.py"], "/api/urls.py": ["/api/views.py"], "/service10/views.py": ["/service20/models.py"], "/post/filters.py": ["/post/models.py"], "/service20/views2.py": ["/service20/models.py"], "/mogae/admin.py": ["/mogae/models.py"], "/service20/admin.py": ["/service20/models.py"], "/member/adm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.