index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
10,604
fferri/geometric_patterns
refs/heads/master
/video7.py
from common import * imgsz=(1280,800) r,a=meshgrid_polar(imgsz) def draw(t=0, **kwargs): h=t*math.pi*2/100 im=3*(3*np.log(1+r))+5*np.sin(a*8+16*np.log(1+r)) im=apply_colormap(im,colormap.rainbow2(h)) return im if __name__ == '__main__': for t in range(100): print('rendering frame %08d...'...
{"/video8.py": ["/common.py"], "/video4.py": ["/common.py"], "/p04.py": ["/common.py"], "/p13.py": ["/common.py"], "/video5.py": ["/common.py"], "/p20.py": ["/common.py"], "/p01.py": ["/common.py"], "/p10.py": ["/common.py"], "/p24.py": ["/common.py"], "/p09.py": ["/common.py"], "/video8b.py": ["/common.py"], "/p16.py"...
10,623
Zearin/bibtexml2
refs/heads/master
/setup.py
# -*- coding: utf-8 -*- '''Convert bibTeX files to XML! Built on Pygments. Useful for manipulating bibTeX data as XML with XML toolsets. If you don't like something about bibtexml2, it's built with Pygments--so you have its mature, widespread ecosystem at your disposal to tweak whatever you want. ''' try: f...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,624
Zearin/bibtexml2
refs/heads/master
/bibtexml2/lexer.py
# -*- coding: utf-8 -*- '''FIXME: <<DocString>> ''' # Based on spec summary at # http://artis.imag.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html #-------------------------------------------------------------------- ## Imports #-------------------------------------------------------------------- ### S...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,625
Zearin/bibtexml2
refs/heads/master
/bibtexml2/filter.py
# -*- coding: utf-8 -*- '''Pygments-style filters.''' ## StdLib from __future__ import ( absolute_import, with_statement, print_function,) ## External from pygments.util import get_bool_opt from pygments.token import Name from pygments.filter import ( Filter, # class-based filters...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,626
Zearin/bibtexml2
refs/heads/master
/tests/lexer_vows.py
# -*- coding: utf-8 -*- ## Generated by PyVows v2.0.4 (2013/07/19) ## http://pyvows.org #-------------------------------------------------------------------- ## Imports #-------------------------------------------------------------------- ### Standard Library from __future__ import ( absolute_import, ...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,627
Zearin/bibtexml2
refs/heads/master
/bibtexml2/utils.py
# -*- coding: utf-8 -*- '''Miscellaneous BibTeX utilties.''' ## STDLIB from __future__ import ( absolute_import, with_statement, print_function, ) import io ## External import six ## Local #------------------------------------------------------------------------------ def _indeces_that_ma...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,628
Zearin/bibtexml2
refs/heads/master
/bibtexml2/formatter.py
# -*- coding: utf-8 -*- '''Pygments formatter. Converts bibTeX to XML.''' #---------------------------------------------------------------------- # Imports #---------------------------------------------------------------------- ## StdLib from __future__ import ( absolute_import, with_statement, print...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,629
Zearin/bibtexml2
refs/heads/master
/bibtexml2/__init__.py
# -*- coding: utf-8 -*- '''Convert bibTeX files to XML! Built on Pygments. Useful for manipulating bibTeX data as XML with XML toolsets. If you don't like something about bibtexml2, it's built with Pygments--so you have its mature, widespread ecosystem at your disposal to tweak whatever you want. ''' ## STDLIB ...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,630
Zearin/bibtexml2
refs/heads/master
/bibtexml2/__main__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- '''{program[human_format]} Usage: {program[cli_format]} [options] <file>... Options: -X, --no-xml Output bibTeX instead of XML ''' #-------------------------------------------------------------------- ## Imports #--------------------------------------------------...
{"/tests/lexer_vows.py": ["/bibtexml2/__init__.py"], "/bibtexml2/__main__.py": ["/bibtexml2/__init__.py"]}
10,631
ranmengyuan/PredictFlow
refs/heads/master
/analyze/forecast.py
from dataBase.sql_helper import conn_db, exe_query, conn_close from sklearn.linear_model import Lasso import random # import numpy as np # import matplotlib.pyplot as plt # import time # from sklearn.metrics import r2_score def get_data(): """ 从数据库中获得数据 :return: """ x_train = [] y_train = []...
{"/analyze/forecast.py": ["/dataBase/sql_helper.py"], "/file/file_processing.py": ["/dataBase/sql_helper.py"], "/manage.py": ["/analyze/forecast.py"]}
10,632
ranmengyuan/PredictFlow
refs/heads/master
/file/file_processing.py
from dataBase.sql_helper import conn_db, exe_table, exe_update, conn_close def read_by_line(address): """ 带缓存的文件读取一行数据 :param address: :return: """ file = open(address) file_content = [] while 1: lines = file.readlines(100000) if not lines: break for...
{"/analyze/forecast.py": ["/dataBase/sql_helper.py"], "/file/file_processing.py": ["/dataBase/sql_helper.py"], "/manage.py": ["/analyze/forecast.py"]}
10,633
ranmengyuan/PredictFlow
refs/heads/master
/bean/shop_info.py
class ShopInfo: """ 商家信息 """ shop_id = 0 # 商家id city_name = '' # 市名 location_id = 0 # 所在位置编号,位置接近的商家具有相同的编号 per_pay = 0 # 人均消费(数值越大消费越高) score = 0 # 评分(数值越大评分越高) comment_cnt = 0 # 评论数(数值越大评论数越多) shop_level = 0 # 门店等级(数值越大门店等级越高) cate_1_name = '' # 一级品类名称 cate_2_na...
{"/analyze/forecast.py": ["/dataBase/sql_helper.py"], "/file/file_processing.py": ["/dataBase/sql_helper.py"], "/manage.py": ["/analyze/forecast.py"]}
10,634
ranmengyuan/PredictFlow
refs/heads/master
/manage.py
# from file.file_processing import read_by_line, shop_info_database, get_user_pay, get_user_view from analyze.forecast import lasso if __name__ == "__main__": # file_content = read_by_line("//Volumes//Transcend//文件//实验室//口碑商家流量预测//dataset//shop_info.txt") # shop_info_database(file_content) # get_user_pay("...
{"/analyze/forecast.py": ["/dataBase/sql_helper.py"], "/file/file_processing.py": ["/dataBase/sql_helper.py"], "/manage.py": ["/analyze/forecast.py"]}
10,635
ranmengyuan/PredictFlow
refs/heads/master
/bean/user.py
class User: """ 用户行为 """ shop_id = 0 # 商家id,与shop_info对应 date = 0 # 距离2015年07月01号的天数 sum = 0 # 用户当天某种行为的次数 def __init__(self): """ 构造函数 :return: """ self.shop_id = 0 self.date = 0 self.sum = 0 def __init__(self, shop_id, date, ...
{"/analyze/forecast.py": ["/dataBase/sql_helper.py"], "/file/file_processing.py": ["/dataBase/sql_helper.py"], "/manage.py": ["/analyze/forecast.py"]}
10,636
ranmengyuan/PredictFlow
refs/heads/master
/dataBase/sql_helper.py
import pymysql # from builtins import int def conn_db(): """ 连接数据库 """ conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='B221gt12345', db='Tianchi', charset='UTF8') return conn def exe_table(cur, sql): """ 创建表格或删除 :param cur: :param sql: :return: ...
{"/analyze/forecast.py": ["/dataBase/sql_helper.py"], "/file/file_processing.py": ["/dataBase/sql_helper.py"], "/manage.py": ["/analyze/forecast.py"]}
10,638
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/admin.py
from django.contrib import admin from .models import weightstat, Workout, Meals admin.site.register(weightstat) admin.site.register(Workout) admin.site.register(Meals)
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,639
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/models.py
from django.db import models from django.contrib.auth.models import User class weightstat(models.Model): weight=models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) height=models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) weightdate=models.DateField() d...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,640
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/migrations/0001_initial.py
# Generated by Django 3.0.5 on 2020-06-16 21:50 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='WeightStat', fields=[ ...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,641
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/migrations/0004_auto_20200616_1509.py
# Generated by Django 3.0.5 on 2020-06-16 22:09 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('fitnessapp', '0003_auto_20200616_1508'), ] operations = [ migrations.AlterField( model_name='me...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,642
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/views.py
from django.shortcuts import render from .models import weightstat, Workout, Meals from. forms import WorkoutForm, WeightForm, MealForm from django.contrib.auth.decorators import login_required def index (request): return render(request, 'fitnessapp/index.html') def getweight(request): type_list=weightstat.ob...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,643
artab-sccc/SCCC-ITC172
refs/heads/master
/pythonclubapp/models.py
from django.db import models from django.contrib.auth.models import User # Create your models here. class meeting(models.Model): meetingtitle=models.CharField(max_length=255) meetingdate=models.DateField() meetingtime=models.DecimalField(max_digits=4, decimal_places=0) meetinglocation=models.CharField(...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,644
artab-sccc/SCCC-ITC172
refs/heads/master
/pythonclubapp/views.py
from django.shortcuts import render, get_object_or_404 from .models import meeting, meetingminutes, resource, event from .forms import ResourceForm, MeetingForm from django.contrib.auth.decorators import login_required # Create your views here. def index(request): return render(request, 'pythonclubapp/index.html'...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,645
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/forms.py
from django import forms from .models import weightstat, Workout, Meals class WorkoutForm(forms.ModelForm): class Meta: model=Workout fields='__all__' class WeightForm(forms.ModelForm): class Meta: model=weightstat fields='__all__' class MealForm(forms.ModelForm): class Me...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,646
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/tests.py
from django.test import TestCase from .models import weightstat, Workout, Meals class MealsTest(TestCase): def test_string(self): name=Meals(mealname="Cookies") self.assertEqual(str(name), name.mealname) class WorkoutTest(TestCase): def test_string(self): name=Workout(workoutname="Push Ups"...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,647
artab-sccc/SCCC-ITC172
refs/heads/master
/fitnessappproject/fitnessapp/urls.py
from django.urls import path, include from . import views urlpatterns=[ path('', views.index, name='index'), path('getweight/', views.getweight, name='weight'), path('getworkout/', views.getworkout, name='workout'), path('getmeals/', views.getmeals, name='meals'), path('newWorkout', views.newWorkou...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,648
artab-sccc/SCCC-ITC172
refs/heads/master
/pythonclubapp/tests.py
from django.test import TestCase from django.urls import reverse from .models import meeting, meetingminutes, resource, event from .views import newResource, getresources from django.contrib.auth.models import User # Tests the 'meeting' model class MeetingTitleTest(TestCase): def test_string(self): meet=me...
{"/fitnessappproject/fitnessapp/admin.py": ["/fitnessappproject/fitnessapp/models.py"], "/fitnessappproject/fitnessapp/views.py": ["/fitnessappproject/fitnessapp/models.py", "/fitnessappproject/fitnessapp/forms.py"], "/pythonclubapp/views.py": ["/pythonclubapp/models.py"], "/fitnessappproject/fitnessapp/forms.py": ["/f...
10,651
gritor111/Villager-Bot
refs/heads/master
/src/cogs/cmds/fun.py
from urllib.parse import quote as urlquote from discord.ext import commands import discord import random import typing import util.cj as cj class Fun(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.k = bot.k async def lang_convert(self, msg, lang): ...
{"/__main__.py": ["/src/bot.py"]}
10,652
gritor111/Villager-Bot
refs/heads/master
/src/speedups/__init__.py
"""Much of the code in this folder is from github.com/Rapptz/discord.py, credit is to the author of discord.py""" import importlib import sys import speedups.mixins import speedups.gateway import speedups.activity import speedups.utils import speedups.message import speedups.ext.commands.cooldowns as speedups_cooldo...
{"/__main__.py": ["/src/bot.py"]}
10,653
gritor111/Villager-Bot
refs/heads/master
/src/util/setup.py
from discord.ext import commands import aiofiles import discord import logging import asyncpg import json import os from util.cj import ClassyDict def villager_bot_intents() -> discord.Intents: intents = discord.Intents.default() intents.guilds = True intents.members = True intents.bans = True in...
{"/__main__.py": ["/src/bot.py"]}
10,654
gritor111/Villager-Bot
refs/heads/master
/src/cogs/core/events.py
from discord.ext import commands import traceback import discord import asyncio import random from util.handlers import handle_message, handle_error from util.misc import cooldown_logic class Events(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.v = bot.v ...
{"/__main__.py": ["/src/bot.py"]}
10,655
gritor111/Villager-Bot
refs/heads/master
/src/cogs/cmds/mod.py
from discord.ext import commands from typing import Union import asyncio import discord class Mod(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.db = bot.get_cog("Database") async def perm_check(self, author, victim): if isinstance(author, discord...
{"/__main__.py": ["/src/bot.py"]}
10,656
gritor111/Villager-Bot
refs/heads/master
/src/cogs/core/database.py
from discord.ext import commands, tasks import asyncio import arrow class Database(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.v = bot.v self.db = bot.db # the asyncpg pool self.update_user_health.start() bot.loop.create_task(self....
{"/__main__.py": ["/src/bot.py"]}
10,657
gritor111/Villager-Bot
refs/heads/master
/__main__.py
import pyximport import numpy pyximport.install(language_level=3, reload_support=True, setup_args={"include_dirs": numpy.get_include()}) import src.bot as bot if __name__ == "__main__": bot.run()
{"/__main__.py": ["/src/bot.py"]}
10,658
gritor111/Villager-Bot
refs/heads/master
/src/bot.py
from concurrent.futures import ThreadPoolExecutor from discord.ext import commands import asyncio import aiohttp import discord import random # import uvloop import arrow import json import sys import os # ensure villager bot modules are accessible sys.path.append(os.path.abspath(os.path.dirname(__file__))) # ensure...
{"/__main__.py": ["/src/bot.py"]}
10,659
gritor111/Villager-Bot
refs/heads/master
/src/cogs/other/webhooks.py
from discord.ext import commands from aiohttp import web import traceback import asyncio import discord import arrow import util.cj as cj class Webhooks(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.v = bot.v self.k = bot.k self.db = bot.get_...
{"/__main__.py": ["/src/bot.py"]}
10,660
gritor111/Villager-Bot
refs/heads/master
/src/cogs/cmds/econ.py
from discord.ext import commands, tasks from collections import defaultdict import functools import discord import asyncio import random import arrow import math from util.misc import lb_logic, cmds_lb, format_required, make_health_bar, calc_total_wealth, emojify_item class Econ(commands.Cog): def __init__(self,...
{"/__main__.py": ["/src/bot.py"]}
10,661
gritor111/Villager-Bot
refs/heads/master
/src/cogs/core/loops.py
from discord.ext import commands, tasks import traceback import discord import random class Loops(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.db = bot.get_cog("Database") self.change_status.start() self.update_fishing_prices.start() ...
{"/__main__.py": ["/src/bot.py"]}
10,662
gritor111/Villager-Bot
refs/heads/master
/src/cogs/cmds/owner.py
from util.misc import recursive_update from discord.ext import commands from typing import Union import functools import aiofiles import asyncio import discord import random import arrow import json import ast import os from util.setup import load_text_async import util.cj as cj class Owner(commands.Cog): def __...
{"/__main__.py": ["/src/bot.py"]}
10,663
gritor111/Villager-Bot
refs/heads/master
/src/cogs/cmds/useful.py
from urllib.parse import quote as urlquote from discord.ext import commands import async_cse import asyncio import discord import psutil import arrow class Useful(commands.Cog): def __init__(self, bot): self.bot = bot self.d = bot.d self.v = bot.v self.google_client = async_cse.S...
{"/__main__.py": ["/src/bot.py"]}
10,664
gritor111/Villager-Bot
refs/heads/master
/src/util/statcord.py
import asyncio import psutil class ShitCordClient: def __init__(self, bot, statcord_key: str): self.bot = bot self.aiohttp = bot.aiohttp self.statcord_key = statcord_key self.d = bot.d self.v = bot.v # setup counters net_io_counter = psutil.net_io_counters...
{"/__main__.py": ["/src/bot.py"]}
10,665
gritor111/Villager-Bot
refs/heads/master
/src/cogs/other/mobs.py
from discord.ext import commands, tasks from util.misc import make_health_bar import asyncio import discord import random import arrow import math import util.cj as cj class Mobs(commands.Cog): # fuck I really don't want to work on this def __init__(self, bot): self.bot = bot self.d = bot.d ...
{"/__main__.py": ["/src/bot.py"]}
10,677
jonathanvanschenck/Monochromator-GUI
refs/heads/master
/monochromator/calibrate.py
#%% import tkinter as tk import os from time import sleep from tkinter import messagebox from tkinter import filedialog from spectrometer import Spectrometer import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from scipy.opti...
{"/example.py": ["/monochromator/monochromator.py", "/monochromator/calibrate.py"]}
10,678
jonathanvanschenck/Monochromator-GUI
refs/heads/master
/monochromator/__init__.py
import .calibrate import .monochromator import .spectrometer
{"/example.py": ["/monochromator/monochromator.py", "/monochromator/calibrate.py"]}
10,679
jonathanvanschenck/Monochromator-GUI
refs/heads/master
/example.py
#%% from monochromator.monochromator import Monochromator from monochromator.calibrate import Calibrate # Instantiate monochromator instance try: mono.close() except: pass mono = Monochromator() # Launch calibration GUI Calibrate(mono)
{"/example.py": ["/monochromator/monochromator.py", "/monochromator/calibrate.py"]}
10,680
jonathanvanschenck/Monochromator-GUI
refs/heads/master
/monochromator/spectrometer.py
"""Allows pyseabreeze spectrometers to be loaded via a popup window ---Classes--- selectionBox: A tk widget to hold a list of tk.Radiobuttons which all refer to the same variable Spectrometer: A wrapper for the seabreeze.spectrometer.Spectrometer class, which automatically searches for available...
{"/example.py": ["/monochromator/monochromator.py", "/monochromator/calibrate.py"]}
10,681
jonathanvanschenck/Monochromator-GUI
refs/heads/master
/monochromator/monochromator.py
#%% import tkinter as tk import os from time import sleep from tkinter import messagebox from tkinter import filedialog import seabreeze.spectrometers as sb import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from scipy.optim...
{"/example.py": ["/monochromator/monochromator.py", "/monochromator/calibrate.py"]}
10,684
loserbbb/tucao
refs/heads/master
/tucao/usermanage/migrations/0002_auto_20170807_0838.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('usermanage', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='telnumb...
{"/tucao/usermanage/views.py": ["/tucao/usermanage/models.py"]}
10,685
loserbbb/tucao
refs/heads/master
/tucao/usermanage/models.py
from django.db import models # Create your models here. class User(models.Model): name=models.CharField(max_length=10) password=models.CharField(max_length=16) born_date=models.DateTimeField(null=True) gender=models.BooleanField() description=models.TextField(blank=True,null=True) head_img=mode...
{"/tucao/usermanage/views.py": ["/tucao/usermanage/models.py"]}
10,686
loserbbb/tucao
refs/heads/master
/tucao/usermanage/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.AutoField(verbose...
{"/tucao/usermanage/views.py": ["/tucao/usermanage/models.py"]}
10,687
loserbbb/tucao
refs/heads/master
/tucao/usermanage/middleware.py
from django.shortcuts import render,HttpResponse,redirect,HttpResponseRedirect try: from django.utils.deprecation import MiddlewareMixin except ImportError: MiddlewareMixin=object class SimpleMiddleware(MiddlewareMixin): def process_request(self,request): if 'user' not in request.session and reques...
{"/tucao/usermanage/views.py": ["/tucao/usermanage/models.py"]}
10,688
loserbbb/tucao
refs/heads/master
/tucao/usermanage/views.py
from django.shortcuts import render from django.http import HttpResponse from .models import User # Create your views here. def index(request): return HttpResponse('hello') def regist(request): if request.method == 'POST': try: user=User.objects.get(name=request.POST.get('name')) ...
{"/tucao/usermanage/views.py": ["/tucao/usermanage/models.py"]}
10,740
EthanZhu90/TALL_Copy
refs/heads/master
/ctrl_model_noContext.py
import numpy as np import tensorflow as tf # from tensorflow.python.framework import dtypes import tensorflow.contrib.rnn as rnn from util.cnn import fc_layer as fc import vs_multilayer from dataset_noContext import TestingDataSet from dataset_noContext import TrainingDataSet import pickle class CTRL_Model(object):...
{"/ctrl_model_noContext.py": ["/dataset_noContext.py"]}
10,741
EthanZhu90/TALL_Copy
refs/heads/master
/ctrl_model.py
import numpy as np import tensorflow as tf from tensorflow.python.framework import dtypes from util.cnn import fc_layer as fc import vs_multilayer from dataset import TestingDataSet from dataset import TrainingDataSet class CTRL_Model(object): def __init__(self, batch_size, train_csv_path, test_csv_path, test_v...
{"/ctrl_model_noContext.py": ["/dataset_noContext.py"]}
10,742
EthanZhu90/TALL_Copy
refs/heads/master
/ctrl_model_noContext_dtfv_covideo_clip.py
import numpy as np import tensorflow as tf from tensorflow.python.framework import dtypes from util.cnn import fc_layer as fc import vs_multilayer from dataset_noContext_dtfv_covideo_clip import TestingDataSet from dataset_noContext_dtfv_covideo_clip import TrainingDataSet class CTRL_Model(object): def __init__...
{"/ctrl_model_noContext.py": ["/dataset_noContext.py"]}
10,743
EthanZhu90/TALL_Copy
refs/heads/master
/dataset_noContext.py
import numpy as np from math import sqrt import os import random import pickle from sklearn.preprocessing import normalize ''' calculate temporal intersection over union ''' def calculate_IoU(i0, i1): union = (min(i0[0], i1[0]), max(i0[1], i1[1])) inter = (max(i0[0], i1[0]), min(i0[1], i1[1])) iou = 1.0*...
{"/ctrl_model_noContext.py": ["/dataset_noContext.py"]}
10,748
craigcurtin/mlb
refs/heads/master
/Game.py
import datetime import pytz import os class Game(object): """Class Game - methods to extract various data pieces of the Game dictionary""" def __init__(self, game_dict): self.game_dict = game_dict def game_id(self): return self.game_dict['game_id'] def game_time(self): retur...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,749
craigcurtin/mlb
refs/heads/master
/todays_game.py
import statsapi import datetime from datetime import datetime as dt from Game import Game import logging import sys import os from cc_mail import cc_mail from util_logger import setup_logger from yagmail import send_yag def todays_game(): today = datetime.date.today() tommorrow = today + datetime.timedelta(d...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,750
craigcurtin/mlb
refs/heads/master
/standings.py
import statsapi def standings(): standings = statsapi.standings(leagueId="103,104", division="all", include_wildcard=True, season=None, standingsTypes=None, ...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,751
craigcurtin/mlb
refs/heads/master
/Roster.py
import re from collections import namedtuple from collections import defaultdict Position = namedtuple('Position', 'pos name') valid_positions = ['P', 'C', '1B', '2B', '3B', 'SS', 'LF', 'CF', 'RF'] class Roster(object): def __init__(self, teamId, roster_list): self.teamId = teamId self.uniform_nu...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,752
craigcurtin/mlb
refs/heads/master
/roster_info.py
import statsapi from Team import Team from datetime import datetime from Roster import Roster from Roster import valid_positions def team_roster(teamId): team_roster = statsapi.roster(teamId, rosterType=None, season=datetime.now().year, date=None) return team_roster if __name__ == '__main__': team_dict = ...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,753
craigcurtin/mlb
refs/heads/master
/linescore_info.py
import statsapi from teams_info import teams_info if __name__ == '__main__': teams_dict = teams_info() for teamId in teams_dict.keys(): most_recent_game_id = statsapi.last_game(teamId) print(statsapi.boxscore(most_recent_game_id)) print(statsapi.linescore(most_recent_game_id)) sta...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,754
craigcurtin/mlb
refs/heads/master
/Team.py
import os # noinspection PyPep8Naming class Team(object): def __init__(self, team_dict): self.team_dict = team_dict def id(self): return self.team_dict['id'] def name(self): return self.team_dict['name'] def link(self): return self.team_dict['link'] def season(s...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,755
craigcurtin/mlb
refs/heads/master
/player_info.py
import statsapi from util_logger import setup_logger import logging from Team import Team import sys def team_info(): # teams = statsapi.get('teams',{'sportIds':1,'activeStatus':'Yes','fields':'teams,name,id,division,league'}) team_dict = {} teams = statsapi.get('teams', {'sportIds': 1, 'activeStatus': 'Y...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,756
craigcurtin/mlb
refs/heads/master
/util_logger.py
import sys import logging from pytz import timezone from datetime import datetime from pathlib import Path # *force* UTC based time in log messages tz = timezone('UTC') # logging formatter, specify UTC as TZ to hardcode def time_tz(*args): return datetime.now(tz).timetuple() # TODO - CSC working this function ...
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,757
craigcurtin/mlb
refs/heads/master
/yagmail.py
import yagmail def send_yag(to_email, subject, contents): yag = yagmail.SMTP() yag.send(to_email, subject, contents)
{"/todays_game.py": ["/Game.py", "/util_logger.py", "/yagmail.py"], "/roster_info.py": ["/Team.py", "/Roster.py"], "/player_info.py": ["/util_logger.py", "/Team.py"]}
10,759
SiddhanthHegde/You-Need-to-Pay-More-Attention
refs/heads/main
/splitAndMake.py
#This file creates a balanced split between the classes and makes it model feedable form import os import pandas as pd from zipfile import ZipFile from utils import move_data, split_data extract_path = 'training_img.zip' with ZipFile(extract_path, 'r') as zipObj: zipObj.extractall() os.mkdir('Troll') os.mkdir('Non...
{"/splitAndMake.py": ["/utils.py"], "/train.py": ["/model.py", "/dataset.py", "/utils.py"], "/test.py": ["/dataset.py", "/model.py", "/utils.py"]}
10,760
SiddhanthHegde/You-Need-to-Pay-More-Attention
refs/heads/main
/train.py
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns plt.style.use("ggplot") import torch import torch.nn as nn import torchvision.transforms as transforms import timm from zipfile import ZipFile import os import time from shutil import copy2 from torch.utils.data import DataL...
{"/splitAndMake.py": ["/utils.py"], "/train.py": ["/model.py", "/dataset.py", "/utils.py"], "/test.py": ["/dataset.py", "/model.py", "/utils.py"]}
10,761
SiddhanthHegde/You-Need-to-Pay-More-Attention
refs/heads/main
/model.py
import torch import torch.nn as nn import timm from transformers import AutoModel class multimodal(nn.Module): def __init__(self): super(multimodal, self).__init__() self.vit = timm.create_model("vit_base_patch16_224", pretrained=True) self.bert = AutoModel.from_pretrained('bert-base-multilingual-cased'...
{"/splitAndMake.py": ["/utils.py"], "/train.py": ["/model.py", "/dataset.py", "/utils.py"], "/test.py": ["/dataset.py", "/model.py", "/utils.py"]}
10,762
SiddhanthHegde/You-Need-to-Pay-More-Attention
refs/heads/main
/dataset.py
import torch from PIL import Image from torch.utils.data import DataLoader class TamilDataset(torch.utils.data.Dataset): def __init__(self,df,tokenizer,max_len,path,transforms=None): self.data_dir = path self.df = df self.tokenizer = tokenizer self.transforms = transforms self.max_len = max_len ...
{"/splitAndMake.py": ["/utils.py"], "/train.py": ["/model.py", "/dataset.py", "/utils.py"], "/test.py": ["/dataset.py", "/model.py", "/utils.py"]}
10,763
SiddhanthHegde/You-Need-to-Pay-More-Attention
refs/heads/main
/utils.py
import os from shutil import copy2 import time import torch def move_data(start,troll,not_troll): for img_name in os.listdir(start): src = os.path.join(start,img_name) if img_name.startswith('N'): copy2(src,not_troll) else: copy2(src,troll) def split_data(start,train,val,split): for i, img...
{"/splitAndMake.py": ["/utils.py"], "/train.py": ["/model.py", "/dataset.py", "/utils.py"], "/test.py": ["/dataset.py", "/model.py", "/utils.py"]}
10,764
SiddhanthHegde/You-Need-to-Pay-More-Attention
refs/heads/main
/test.py
import torch import pandas as pd from dataset import create_data_loader from model import multimodal from utils import get_predictions from zipfile import ZipFile LOAD_MODEL = True device = 'cuda' model = multimodal() model = model.to(device) if LOAD_MODEL: model.load_state_dict(torch.load('vit-bert-1.0val.bin')...
{"/splitAndMake.py": ["/utils.py"], "/train.py": ["/model.py", "/dataset.py", "/utils.py"], "/test.py": ["/dataset.py", "/model.py", "/utils.py"]}
10,767
DarkmatterVale/HaikuPorts-Cleaner
refs/heads/master
/cleaner.py
from Options import getOption from Recipe import RecipeFixer import os import timeit class Cleaner(): """ Main class for the ports cleaner. This class handles the management of each individual "clean" task/process """ def __init__(self, options, args): """ Clean the haikuports tr...
{"/hp-cleaner.py": ["/cleaner.py", "/Options.py"]}
10,768
DarkmatterVale/HaikuPorts-Cleaner
refs/heads/master
/hp-cleaner.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 Vale Tolpegin # Distributed under the terms of the MIT License. # -- Modules ------------------------------------------------------------------ from cleaner import Cleaner from Options import parseOptions # -- Start ------------------------------------...
{"/hp-cleaner.py": ["/cleaner.py", "/Options.py"]}
10,769
DarkmatterVale/HaikuPorts-Cleaner
refs/heads/master
/Options.py
# -*- coding: utf-8 -*- # # Copyright 2016 Vale Tolpegin # Distributed under the terms of the MIT License. # -- Modules ------------------------------------------------------------------ from optparse import OptionParser # -- global options ----------------------------------------------------------- global __Optio...
{"/hp-cleaner.py": ["/cleaner.py", "/Options.py"]}
10,770
DarkmatterVale/HaikuPorts-Cleaner
refs/heads/master
/recipe.py
import os import re class RecipeFixer(): """ Parses an individual recipe and fixes it. """ def __init__(self, baseDir, name, log): # Set up the ordering for recipe files self.order = [ "SUMMARY", "DESCRIPTION", "HOMEPAGE", "COPYRIGHT", ...
{"/hp-cleaner.py": ["/cleaner.py", "/Options.py"]}
10,850
brianjohnhaas/indrops
refs/heads/master
/count_barcode_distribution.py
import re from collections import defaultdict try: import cPickle as pickle except: import pickle from indrops import from_fastq, to_fastq def count(): barcode_read_counter = defaultdict(int) for name, seq, qual in from_fastq(sys.stdin): split_name = name.split(':') cell_name = split_n...
{"/count_barcode_distribution.py": ["/indrops.py"], "/trim_polyA_and_filter_low_complexity_reads.py": ["/indrops.py"]}
10,851
brianjohnhaas/indrops
refs/heads/master
/quantify_umifm_from_alignments.py
import pysam from collections import defaultdict try: import cPickle as pickle except: import pickle from copy import copy from itertools import combinations from numpy import memmap # from indrops import load_indexed_memmapped_array def print_to_log(msg): """ Wrapper to eventually log in smart way, ins...
{"/count_barcode_distribution.py": ["/indrops.py"], "/trim_polyA_and_filter_low_complexity_reads.py": ["/indrops.py"]}
10,852
brianjohnhaas/indrops
refs/heads/master
/indrops.py
import os, subprocess import itertools import operator from collections import defaultdict, OrderedDict import errno # cPickle is a faster version of pickle that isn't installed in python3 # inserted try statement just in case try: import cPickle as pickle except: import pickle from io import BytesIO import nu...
{"/count_barcode_distribution.py": ["/indrops.py"], "/trim_polyA_and_filter_low_complexity_reads.py": ["/indrops.py"]}
10,853
brianjohnhaas/indrops
refs/heads/master
/annotate_mouse_transcriptome.py
import re in_genes="Mus_musculus.GRCm38.84.with_tid.gtf" out_genes="Mus_musculus.GRCm38.84.annotated.gtf" accepted_gene_biotypes_for_NA_transcripts = set(["IG_V_gene","IG_J_gene","protein_coding","TR_J_gene","TR_D_gene","TR_V_gene","IG_C_gene","IG_D_gene","TR_C_gene"]) with open(in_genes, 'r') as in_f, open(out_genes, ...
{"/count_barcode_distribution.py": ["/indrops.py"], "/trim_polyA_and_filter_low_complexity_reads.py": ["/indrops.py"]}
10,854
brianjohnhaas/indrops
refs/heads/master
/trim_polyA_and_filter_low_complexity_reads.py
import re try: import cPickle as pickle except: import pickle from indrops import from_fastq, to_fastq def low_complexity_filter(args): total_reads = 0 kept_reads = 0 rejected_because_complexity_too_low = 0 rejected_because_too_short = 0 keep_polyA_length = 4 single_base_runs_regex = '|...
{"/count_barcode_distribution.py": ["/indrops.py"], "/trim_polyA_and_filter_low_complexity_reads.py": ["/indrops.py"]}
10,870
dremdem/test_field
refs/heads/master
/field/models.py
from django.db import models from django.db.models.expressions import RawSQL # Create your models here. class DManagerWithCount(models.Manager): def get_queryset(self): return super().get_queryset().annotate(division_amount=RawSQL(""" select count(*) from field_department fd, field_employee fe ...
{"/field/views.py": ["/field/models.py"]}
10,871
dremdem/test_field
refs/heads/master
/field/views.py
from django.shortcuts import render from .models import Division # Create your views here. def index(request): d = Division.obj_with_count.all() conext = {'division': d} return render(request, 'field/index.html', context=conext)
{"/field/views.py": ["/field/models.py"]}
10,876
TheZorcerer/path.py
refs/heads/main
/data.py
import json class Data(object): def __init__(self): with open("data/gunsmith-weapons.json") as f1: with open("data/gunsmith-attachments.json") as f2: self.weapons_data = json.load(f1) self.attachments_data = json.load(f2) f1.close() f2.close() self.weapons = list() for weapon in self.weapons_...
{"/command_handler.py": ["/data.py", "/bot_utils.py"], "/path.py": ["/command_handler.py", "/bot_utils.py"]}
10,877
TheZorcerer/path.py
refs/heads/main
/init_bot.py
f = open("token.txt","w") f.write(input("your token? ")) f.close() f2 = open("guild_prefs.json","w") f2.write("{}") f2.close()
{"/command_handler.py": ["/data.py", "/bot_utils.py"], "/path.py": ["/command_handler.py", "/bot_utils.py"]}
10,878
TheZorcerer/path.py
refs/heads/main
/command_handler.py
import discord import data import bot_utils class handler(): def __init__(self,client): self.client = client self.gun_data = data.Data() def handle(self,message): prefix = self.client.guild_preferences[str(message.guild.id)]["prefix"] if(message.content[:len(prefix)] == prefix): return self.handler(messa...
{"/command_handler.py": ["/data.py", "/bot_utils.py"], "/path.py": ["/command_handler.py", "/bot_utils.py"]}
10,879
TheZorcerer/path.py
refs/heads/main
/bot_utils.py
import discord import json def check_guilds(client): f = open("guild_prefs.json") guild_preferences = json.load(f) for guild in client.guilds: if(str(guild.id) not in list(guild_preferences.keys())): print("new guild with ID",guild.id) guild_preferences[guild.id] = {"allowed_channels":[],"on":True,"prefix":...
{"/command_handler.py": ["/data.py", "/bot_utils.py"], "/path.py": ["/command_handler.py", "/bot_utils.py"]}
10,880
TheZorcerer/path.py
refs/heads/main
/path.py
import json import discord import command_handler import bot_utils import signal import sys client = discord.Client() handler = command_handler.handler(client) def on_exit(signal, frame): bot_utils.save_preferences(client) print("closing!") sys.exit(0) @client.event async def on_ready(): print("logged in as"+st...
{"/command_handler.py": ["/data.py", "/bot_utils.py"], "/path.py": ["/command_handler.py", "/bot_utils.py"]}
10,881
callidus/playbot
refs/heads/master
/playbot/plugins/CvH/__init__.py
import App # noqa
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,882
callidus/playbot
refs/heads/master
/playbot/main.py
from __future__ import absolute_import from playbot import bot from playbot.plugins import card from playbot.plugins import control from playbot.plugins import CvH from playbot.plugins import dice from playbot.plugins import fortune from playbot.plugins import say from playbot.plugins import link_peek import logging...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,883
callidus/playbot
refs/heads/master
/playbot/plugins/card.py
# flake8: noqa """ broken for now #!/usr/bin/env python # -*- coding: utf-8 -*- import re import random import logging class Card: def __init__(self,bot): self.log = logging.getLogger(__name__) self.currHands = {} self.dealer = bot.nickname self.handInProgress = False @staticmethod def ...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,884
callidus/playbot
refs/heads/master
/playbot/plugins/fortune/fortune.py
from __future__ import absolute_import from playbot.plugins.fortune import data_source import logging import os import random class Fortune(object): def __init__(self, db, prefix=None): self.data = data_source.DataSource() if os.path.isfile(db): self.data.open_db(db) else: ...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,885
callidus/playbot
refs/heads/master
/playbot/plugins/fortune/__init__.py
import fortune # noqa
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,886
callidus/playbot
refs/heads/master
/playbot/plugins/fortune/build_db.py
from __future__ import absolute_import from __future__ import print_function import os import re import sys from playbot.plugins.fortune import data_source db = data_source.DataSource() if os.path.isfile(sys.argv[1]): db.open_db(sys.argv[1]) else: db.build_db(sys.argv[1]) with open(sys.argv[2], 'r') as f:...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,887
callidus/playbot
refs/heads/master
/playbot/plugins/fortune/data_source.py
from __future__ import absolute_import import sqlite3 as dbapi class DataSource(object): def __init__(self): self.conn = None def __del__(self): if self.conn: self.conn.close() def open_db(self, name): """open an existing database.""" self.conn = dbapi.conne...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,888
callidus/playbot
refs/heads/master
/playbot/plugins/CvH/AddWhiteData.py
import os import sys import DataSource from future import print_function # noqa db = DataSource.DataSource() if os.path.isfile("./cvh.db"): db.openDB("./cvh.db") else: db.buildDB("./cvh.db") with open(sys.argv[1], 'r') as f: data = f.read() items = data.split("<>") for key, item in enumerate(i...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,889
callidus/playbot
refs/heads/master
/playbot/plugins/control.py
class Disconnect(object): def __call__(self, bot, e, cmd, *arg): bot.disconnect() class Die(object): def __call__(self, bot, e, cmd, *arg): bot.die()
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,890
callidus/playbot
refs/heads/master
/playbot/plugins/say.py
import logging class Say(object): def __init__(self): self.log = logging.getLogger(__name__) def __call__(self, bot, e, cmd, *arg): msg = "" if len(arg) == 0: msg = "say what?" else: msg = " ".join(arg) self.log.info("Saying: '%s'", msg) ...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,891
callidus/playbot
refs/heads/master
/playbot/plugins/CvH/App.py
import os import random import DataSource class Phrase(object): def __init__(self, data): self.title = data[0] self.text = data[1] self.numSlots = int(data[2]) self.slots = [] def fillSlot(self, data): self.slots.append(data[1]) def __str__(self): string ...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,892
callidus/playbot
refs/heads/master
/playbot/plugins/CvH/DataSource.py
import sqlite3 as dbapi class DataSource(object): def __init__(self): self.conn = None def __del__(self): if self.conn: self.conn.close() def openDB(self, name): """open an existing database.""" self.conn = dbapi.connect(name) def buildDB(self, name): ...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}
10,893
callidus/playbot
refs/heads/master
/playbot/plugins/dice.py
import logging import random class Dice: def __init__(self): self.log = logging.getLogger(__name__) def __call__(self, bot, e, cmd, *arg): msg = "" if len(arg) == 0: msg = "roll some dice, e.g. 'roll 2d6-2'" else: num, max = arg[0].lower().split('d') ...
{"/playbot/plugins/fortune/fortune.py": ["/playbot/plugins/fortune/__init__.py"], "/playbot/plugins/fortune/build_db.py": ["/playbot/plugins/fortune/__init__.py"]}