index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
52,003
opsiff/djangowebsite
refs/heads/master
/XianYuBack/message/migrations/0001_initial.py
# Generated by Django 2.2.7 on 2019-11-28 13:51 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Message', fields=[ ('msgId', models.CharFie...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,004
opsiff/djangowebsite
refs/heads/master
/XianYuBack/authorize/views.py
from django.shortcuts import render from django.http import HttpResponse, HttpResponseNotFound,JsonResponse from django.views.decorators.http import require_http_methods from .models import User,OnlineUser import json from .utils import jwcAuth from .utils import Token # Create your views here. @require_http_metho...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,005
opsiff/djangowebsite
refs/heads/master
/XianYuBack/message/views.py
from django.shortcuts import render import json,time import os from PIL import Image from utils.common import hashFile from .models import Message from django.http import HttpResponse, HttpResponseNotFound,JsonResponse # Create your views here. def returnDetail(request,id,category): pass def submmit(request,cat...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,006
opsiff/djangowebsite
refs/heads/master
/XianYuBack/message/urls.py
from django.contrib import admin from django.urls import path from . import views """ 路由到一下地址 /message/<category>/<id>/detail GET方式 拿到某一类的某个具体信息 /message/<categoyy>/submmit POST方式 /message/<category>/list/<sort> 某一类按照某种方式排序的前30列表 /message/<categoyy>/returnList POST方式 """ app_name='message' urlpatterns = [ ...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,007
opsiff/djangowebsite
refs/heads/master
/XianYuBack/testApi.py
import requests import json import time form = { "muser": "04170324", "passwd": "10086KKDDaaggccd" } def Login(): x = requests.post("http://122.112.159.211/authorize/loginIn", data=form) print(x.text) def LoginOut(): x = requests.post("http://127.0.0.1:8000/authorize/loginOut", data=form) prin...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,008
opsiff/djangowebsite
refs/heads/master
/XianYuBack/message/models.py
from django.db import models # Create your models here. class Message(models.Model): msgId=models.CharField(max_length=30,primary_key=True) #信息ID, linkman=models.CharField(max_length=20) # userID=models.CharField(max_length=20,default='123456789') contactWay=models.CharField(max_length=30) price=m...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,009
opsiff/djangowebsite
refs/heads/master
/XianYuBack/authorize/urls.py
from django.contrib import admin from django.urls import path from . import views """ 路由到一下地址 /authorize/loginIn 登入 /authorize/loginOut 注销 """ app_name='authorize' urlpatterns = [ path('loginIn',views.loginIn), path('loginOut',views.loginOut) ]
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,010
opsiff/djangowebsite
refs/heads/master
/XianYuBack/authorize/models.py
from django.db import models # Create your models here. class OnlineUser(models.Model):#维护一个token表 account = models.CharField(max_length=9, primary_key=True) token = models.CharField(max_length=27) class User(models.Model): #已经注册的用户 account=models.CharField(max_length=9,primary_key=True) passwd=m...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,011
opsiff/djangowebsite
refs/heads/master
/XianYuBack/authorize/utils/Token.py
import time def get_token(userNumber): t=time.time() x=int(round(t*1000000)) token=str(x)+userNumber return token # 1574842175560572041702324 # 1574842197056093041702324 if __name__=="__main__": print(get_token('041702324'))
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,012
opsiff/djangowebsite
refs/heads/master
/XianYuBack/utils/common.py
import hashlib def hashFile(file): pass
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,013
opsiff/djangowebsite
refs/heads/master
/XianYuBack/authorize/migrations/0001_initial.py
# Generated by Django 2.2.7 on 2019-11-28 13:51 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='OnlineUser', fields=[ ('account', models.Ch...
{"/XianYuBack/authorize/views.py": ["/XianYuBack/authorize/models.py"]}
52,018
rlr/fjord
refs/heads/master
/fjord/base/tests/test_forms.py
from django.core.exceptions import ValidationError from django.test import TestCase from fjord.base.forms import EnhancedURLField from fjord.base.tests import eq_ class EnhancedURLFieldTests(TestCase): def test_valid(self): test_data = [ # expected, url ('about:mozilla', 'about:mo...
{"/fjord/feedback/tests/test_models.py": ["/fjord/search/tests/__init__.py"]}
52,019
rlr/fjord
refs/heads/master
/fjord/base/models.py
import json from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _lazy from fjord.base import forms from fjord.base.validators import EnhancedURLValidator # Common base model for all fjord models ModelBase = models.Model class Profile(model...
{"/fjord/feedback/tests/test_models.py": ["/fjord/search/tests/__init__.py"]}
52,020
rlr/fjord
refs/heads/master
/fjord/suggest/tests/test_dummy.py
import datetime from fjord.base.tests import eq_, TestCase from fjord.feedback.tests import ResponseFactory from fjord.suggest import get_suggesters from fjord.suggest.utils import get_suggestions from fjord.suggest.providers.dummy import DummySuggester from fjord.suggest.tests import SuggesterTestMixin class DummyS...
{"/fjord/feedback/tests/test_models.py": ["/fjord/search/tests/__init__.py"]}
52,021
rlr/fjord
refs/heads/master
/fjord/search/tests/__init__.py
import time from django.conf import settings import factory from elasticsearch.exceptions import NotFoundError from fjord.base.tests import BaseTestCase from fjord.search.index import get_index, get_es from fjord.search.models import Record class ElasticTestCase(BaseTestCase): """Base class for Elastic Search ...
{"/fjord/feedback/tests/test_models.py": ["/fjord/search/tests/__init__.py"]}
52,022
rlr/fjord
refs/heads/master
/fjord/base/forms.py
from django.forms import fields from fjord.base.validators import EnhancedURLValidator class EnhancedURLField(fields.URLField): """URLField that also supports about: and chrome:// urls""" def __init__(self, max_length=None, min_length=None, *args, **kwargs): super(EnhancedURLField, self).__init__( ...
{"/fjord/feedback/tests/test_models.py": ["/fjord/search/tests/__init__.py"]}
52,023
rlr/fjord
refs/heads/master
/fjord/feedback/tests/test_models.py
import datetime from fjord.base.tests import eq_, TestCase from fjord.feedback.config import TRUNCATE_LENGTH from fjord.feedback.models import ( Product, Response, ResponseEmail, ResponseContext, ResponsePI, ResponseMappingType, purge_data ) from fjord.feedback.tests import ( ResponseFa...
{"/fjord/feedback/tests/test_models.py": ["/fjord/search/tests/__init__.py"]}
52,033
pedantix/corona
refs/heads/master
/corona/plotting.py
from bokeh.plotting import figure, show from bokeh.embed import file_html from bokeh.resources import CDN from collections import Counter from corona.selector import Selector def get_counts_by_country(jh_data, field, selector=None): if selector is None: selector = Selector() count = Counter() for...
{"/corona/read_data.py": ["/corona/file_names.py"]}
52,034
pedantix/corona
refs/heads/master
/corona/read_data.py
from csv import DictReader from glob import glob from datetime import datetime from corona.file_names import file_names def read_data_raw(): filename = file_names['ts_data'] return list(DictReader(open(filename, 'r', encoding='utf-8-sig'))) def get_jh_files(): return sorted(glob(file_names['jh_dir_updat...
{"/corona/read_data.py": ["/corona/file_names.py"]}
52,035
pedantix/corona
refs/heads/master
/corona/file_names.py
""" Keep all filename/path logic here rather than polluting code with hardcoded paths """ import os data_dir_default = 'data' tmp_dir = 'tmp' data_dir = os.getenv('CORONA_DATA_DIR', data_dir_default) novel_dir = "%s/novel" % data_dir jh_dir = "%s/jh/COVID-19-master_2020_03_03/csse_covid_19_data/csse_covid_19_daily_re...
{"/corona/read_data.py": ["/corona/file_names.py"]}
52,052
Brian-Doucet/zillow
refs/heads/master
/zillow.py
#! python #!/usr/bin/python3 """Program to fetch data on sold homes from Zillow""" import csv import json from typing import List from bs4 import BeautifulSoup import requests from models.zillow import ZillowAddress, ZillowData, ZillowRequest from utils import get_home_details, get_facts_and_features class Zillow...
{"/zillow.py": ["/models/zillow.py", "/utils.py"]}
52,053
Brian-Doucet/zillow
refs/heads/master
/models/zillow.py
from typing import Optional, Dict, Any from pydantic import BaseModel from constants import ZILLOW_URL, ZILLOW_QUERY_PARAMS, ZILLOW_QUERY_HEADERS class ZillowAddress(BaseModel): def header_fields(self): return self.__fields__ class ZillowData(BaseModel): zpid: Optional[str] property_url: Optio...
{"/zillow.py": ["/models/zillow.py", "/utils.py"]}
52,054
Brian-Doucet/zillow
refs/heads/master
/utils.py
#!/usr/bin/python3 """Set of functions for parsing HTML from Zillow""" import json import re from bs4 import BeautifulSoup # HTML output from an example property listing. Saves sending repeated requests # when testing these functions. sample_listing_html = open("zillow_sample.txt", "r", encoding='utf-8').read() cont...
{"/zillow.py": ["/models/zillow.py", "/utils.py"]}
52,055
vtt-info/eiscp-micropython
refs/heads/main
/src/eiscp/eiscp.py
import select import socket import time import uasyncio from .core import ( ISCPMessage, command_to_iscp, command_to_packet, eISCPPacket, filter_for_message, iscp_to_command, parse_info, ) class eISCP: """Implements the eISCP interface to Onkyo receivers. This uses a blocking int...
{"/src/eiscp/eiscp.py": ["/src/eiscp/core.py"], "/src/eiscp/discovery.py": ["/src/eiscp/core.py", "/src/eiscp/eiscp.py"], "/src/eiscp/__init__.py": ["/src/eiscp/discovery.py", "/src/eiscp/eiscp.py"]}
52,056
vtt-info/eiscp-micropython
refs/heads/main
/src/eiscp/discovery.py
import socket import time import network import uasyncio from .core import eISCPPacket, parse_info from .eiscp import eISCP def get_current_ip_address() -> str: wlan_network = network.WLAN(network.STA_IF) if not wlan_network.isconnected(): raise OSError("Must connect to network first") connectio...
{"/src/eiscp/eiscp.py": ["/src/eiscp/core.py"], "/src/eiscp/discovery.py": ["/src/eiscp/core.py", "/src/eiscp/eiscp.py"], "/src/eiscp/__init__.py": ["/src/eiscp/discovery.py", "/src/eiscp/eiscp.py"]}
52,057
vtt-info/eiscp-micropython
refs/heads/main
/src/eiscp/__init__.py
# flake8: noqa: F401 from .discovery import discover from .eiscp import eISCP
{"/src/eiscp/eiscp.py": ["/src/eiscp/core.py"], "/src/eiscp/discovery.py": ["/src/eiscp/core.py", "/src/eiscp/eiscp.py"], "/src/eiscp/__init__.py": ["/src/eiscp/discovery.py", "/src/eiscp/eiscp.py"]}
52,058
vtt-info/eiscp-micropython
refs/heads/main
/src/eiscp/core.py
import re import struct import time from collections import namedtuple class ISCPMessage(object): """Deals with formatting and parsing data wrapped in an ISCP containers. The docs say: ISCP (Integra Serial Control Protocol) consists of three command characters and parameter character(s) of var...
{"/src/eiscp/eiscp.py": ["/src/eiscp/core.py"], "/src/eiscp/discovery.py": ["/src/eiscp/core.py", "/src/eiscp/eiscp.py"], "/src/eiscp/__init__.py": ["/src/eiscp/discovery.py", "/src/eiscp/eiscp.py"]}
52,065
NervenCid/omnibnk
refs/heads/master
/users/views.py
from django.shortcuts import render, redirect #Importamos el modulo de mensajes from django.contrib import messages #Importamos from .forms import UserRegisterForm #Importamos los decoradores from django.contrib.auth.decorators import login_required #Creamos las vistas para usuario #Registro def register(request)...
{"/movies/admin.py": ["/movies/models.py"], "/movies/views.py": ["/movies/models.py"]}
52,066
NervenCid/omnibnk
refs/heads/master
/movies/admin.py
from django.contrib import admin #Importamos los modelos from .models import Post #Registramos los modelos dentro del 'admin' admin.site.register(Post)
{"/movies/admin.py": ["/movies/models.py"], "/movies/views.py": ["/movies/models.py"]}
52,067
NervenCid/omnibnk
refs/heads/master
/movies/models.py
#Importamos el modulo para modelos from django.db import models #Importamos el modulos para autenticacion de usuarios from django.contrib.auth.models import User #Importamos el modulo 'reverse' from django.urls import reverse #Creamos el modelo de Post de las peliculas class Post(models.Model): movie_name = models...
{"/movies/admin.py": ["/movies/models.py"], "/movies/views.py": ["/movies/models.py"]}
52,068
NervenCid/omnibnk
refs/heads/master
/movies/views.py
#Importamos el modulo render from django.shortcuts import render #Importamos los 'mixin' from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin #Importamos el modulo 'HttpResponse' from django.http import HttpResponse #Importamos el modulo de lista de vistas from django.views.generic import (...
{"/movies/admin.py": ["/movies/models.py"], "/movies/views.py": ["/movies/models.py"]}
52,071
samueldaviddelacruz/restaurant_graphql_CRUD
refs/heads/master
/restaurant_graphql_api/schema.py
import graphene import restaurantapi.schema class Query(restaurantapi.schema.Query,graphene.ObjectType): # This class will inherit from multiple Queries # as we begin to add more apps to our project pass class Mutations(restaurantapi.schema.Mutation,graphene.ObjectType): # This class will inherit f...
{"/restaurant_graphql_api/schema.py": ["/restaurantapi/schema.py"], "/restaurantapi/schema.py": ["/restaurantapi/models.py"]}
52,072
samueldaviddelacruz/restaurant_graphql_CRUD
refs/heads/master
/restaurantapi/models.py
from django.db import models # Create your models here. class Category(models.Model): name = models.TextField(null=False, blank=False) description = models.TextField(null=True, blank=True) def __str__(self): return self.name class Dish(models.Model): category = models.ForeignKey(Category,o...
{"/restaurant_graphql_api/schema.py": ["/restaurantapi/schema.py"], "/restaurantapi/schema.py": ["/restaurantapi/models.py"]}
52,073
samueldaviddelacruz/restaurant_graphql_CRUD
refs/heads/master
/restaurantapi/schema.py
import graphene from graphene_django.types import DjangoObjectType from restaurantapi.models import Category,Dish class CategoryType(DjangoObjectType): class Meta: model = Category class DishType(DjangoObjectType): class Meta: model = Dish class Query(object): category = graphene.Fie...
{"/restaurant_graphql_api/schema.py": ["/restaurantapi/schema.py"], "/restaurantapi/schema.py": ["/restaurantapi/models.py"]}
52,074
samueldaviddelacruz/restaurant_graphql_CRUD
refs/heads/master
/restaurantapi/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-27 21:17 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
{"/restaurant_graphql_api/schema.py": ["/restaurantapi/schema.py"], "/restaurantapi/schema.py": ["/restaurantapi/models.py"]}
52,075
samueldaviddelacruz/restaurant_graphql_CRUD
refs/heads/master
/restaurantapi/migrations/0002_auto_20171227_2137.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-27 21:37 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('restaurantapi', '0001_initial'), ] operations = [ migrations.RenameField( ...
{"/restaurant_graphql_api/schema.py": ["/restaurantapi/schema.py"], "/restaurantapi/schema.py": ["/restaurantapi/models.py"]}
52,084
Straeng/nibe2influx
refs/heads/master
/src/nibe2influx_runner.py
from nibe2influx.nibe2influx import main class TestDatabase: def persist(self, measurement): print(measurement) if __name__ == '__main__': main(db=TestDatabase())
{"/src/nibe2influx/__main__.py": ["/src/nibe2influx/nibe2influx.py"], "/src/nibe2influx/nibe2influx.py": ["/src/nibe2influx/nibeapi.py"]}
52,085
Straeng/nibe2influx
refs/heads/master
/src/nibe2influx/__main__.py
from .nibe2influx import main main()
{"/src/nibe2influx/__main__.py": ["/src/nibe2influx/nibe2influx.py"], "/src/nibe2influx/nibe2influx.py": ["/src/nibe2influx/nibeapi.py"]}
52,086
Straeng/nibe2influx
refs/heads/master
/src/setup.py
from setuptools import setup setup( name="nibe2influx", packages=["nibe2influx"], version="0.1", # Dependencies install_requires=['requests_oauthlib>=0.8.0', 'influxdb>=4.1'], package_data={ # Additional files to include '': ['sensors.json', 'config.json.template'], }, ...
{"/src/nibe2influx/__main__.py": ["/src/nibe2influx/nibe2influx.py"], "/src/nibe2influx/nibe2influx.py": ["/src/nibe2influx/nibeapi.py"]}
52,087
Straeng/nibe2influx
refs/heads/master
/src/nibe2influx/nibe2influx.py
import json import time import itertools import os import sys from influxdb import InfluxDBClient from .nibeapi import NibeApi _CONFIG_DIR = sys.prefix+'/etc/nibe2influx/' _CONFIG_FILE = _CONFIG_DIR+'config.json' _SENSOR_FILE = _CONFIG_DIR+'sensors.json' _TOKEN_FILE = _CONFIG_DIR+'token.json' class InfluxDatabase()...
{"/src/nibe2influx/__main__.py": ["/src/nibe2influx/nibe2influx.py"], "/src/nibe2influx/nibe2influx.py": ["/src/nibe2influx/nibeapi.py"]}
52,088
Straeng/nibe2influx
refs/heads/master
/src/nibe2influx/nibeapi.py
import json from requests_oauthlib import OAuth2Session class NibeApi: ''' TODO: Currently assumes that authorization is already done and there is a tokej.json file. ''' _BASE_URL = 'https://api.nibeuplink.com' _TOKEN_URL = _BASE_URL+'/oauth/token' _API_URL = _BASE_UR...
{"/src/nibe2influx/__main__.py": ["/src/nibe2influx/nibe2influx.py"], "/src/nibe2influx/nibe2influx.py": ["/src/nibe2influx/nibeapi.py"]}
52,092
Talha-Altair/Highcharts_flask_csv-APP
refs/heads/main
/app.py
''' Source: Author: Altair ''' from flask import Flask,render_template, jsonify, request import random import json import data_c app = Flask(__name__) @app.route("/", methods=["GET","POST"]) def startpy(): result = { "Greetings" : "Altair" } #return jsonify(result) return render_templa...
{"/app.py": ["/data_c.py"]}
52,093
Talha-Altair/Highcharts_flask_csv-APP
refs/heads/main
/data_c.py
import pandas as pd def get_data(): df = pd.read_csv('fire.csv') year = df['year'].tolist() wildfires = df['wildfires'].tolist() result_dict = { 'year' : year, 'wildfires' : wildfires } #print(result_dict) return result_di...
{"/app.py": ["/data_c.py"]}
52,094
FToovvr/adnmb-quests-watcher
refs/heads/master
/commons/config.py
from typing import Optional, List from dataclasses import dataclass from pathlib import Path from os.path import join import re import yaml import anobbsclient @dataclass(frozen=True) class ClientConfig: host: str client_user_agent: str client_appid: Optional[str] user_userhash: str def cre...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,095
FToovvr/adnmb-quests-watcher
refs/heads/master
/0_tick.py
#!/usr/bin/env python3 from datetime import datetime, timedelta, date import os import subprocess import pprint import time from tendo import singleton import psycopg2 import sys os.chdir(sys.path[0]) # noqa from commons.consts import local_tz, get_target_date from commons.config import load_config from models.act...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,096
FToovvr/adnmb-quests-watcher
refs/heads/master
/1_collect.py
#!/usr/bin/env python3 from __future__ import annotations from typing import Optional, Dict, List, Any from dataclasses import dataclass, field import traceback import argparse import sys import os from datetime import datetime, timedelta import json import logging import logging.config import traceback import psyco...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,097
FToovvr/adnmb-quests-watcher
refs/heads/master
/commons/consts.py
from datetime import datetime, timedelta, date from dateutil import tz local_tz = tz.gettz('Asia/Shanghai') ZWSP = '\u200b' WORD_JOINER = '\u2060' OMITTING = ZWSP + "…" def get_target_date(now: datetime = None) -> date: if now is None: now = datetime.now(tz=local_tz) return (now - timedelta(hours=...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,098
FToovvr/adnmb-quests-watcher
refs/heads/master
/fun/generate_wordcloud.py
#!/usr/bin/env python3 from typing import Optional, Dict, List, Set, Callable from dataclasses import dataclass from collections import defaultdict, Counter from operator import add from functools import reduce from datetime import datetime, date, timedelta import hashlib from random import Random from pathlib import...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,099
FToovvr/adnmb-quests-watcher
refs/heads/master
/commons/include_filters.py
from __future__ import annotations from typing import Any, Type, Union, Literal, List, Dict from dataclasses import dataclass, field from abc import ABC, abstractmethod from .thread_stats import ThreadStats, Counts class IncludeRule(ABC): @classmethod def build(cls, builder: IncludeRuleBuilder, args: Any) -...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,100
FToovvr/adnmb-quests-watcher
refs/heads/master
/3_generate_text_report.py
#!/usr/bin/env python3 from __future__ import annotations from typing import Any, Tuple, List, Dict, OrderedDict, Optional, Union, Literal from dataclasses import dataclass, field import argparse from pathlib import Path import sys import os from datetime import datetime, timedelta, time, date import logging import l...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,101
FToovvr/adnmb-quests-watcher
refs/heads/master
/2.6_check_completed.py
#!/usr/bin/env python3 from typing import List from dataclasses import dataclass import traceback import logging import logging.config import argparse from datetime import datetime, date import sys from pathlib import Path import re import psycopg2 import anobbsclient from commons.consts import local_tz from commo...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,102
FToovvr/adnmb-quests-watcher
refs/heads/master
/models/publication_record.py
from typing import Optional, List from dataclasses import dataclass, field from datetime import datetime, date import uuid import json import psycopg2 @dataclass(frozen=True) class PublishedPost: report_page_number: int reply_post_id: Optional[int] reply_offset: Optional[int] @dataclass(frozen=True) ...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,103
FToovvr/adnmb-quests-watcher
refs/heads/master
/commons/debugging.py
from datetime import datetime import sys sys.path.append("..") # noqa from models.analyzing import ThreadStats super_huge_thread_pg = ThreadStats( id=123456789, created_at=datetime(2006, 1, 2, 15, 4, 5, 999999), is_new=False, is_disappeared=False, title=None, name=None, raw_content="测试撑爆"*...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,104
FToovvr/adnmb-quests-watcher
refs/heads/master
/2.5_check_disappeared.py
#!/usr/bin/env python3 from typing import List from dataclasses import dataclass import traceback import logging import logging.config import argparse from datetime import datetime, date, timedelta import sys from pathlib import Path import psycopg2 import anobbsclient from anobbsclient.walk import create_walker, B...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,105
FToovvr/adnmb-quests-watcher
refs/heads/master
/commons/thread_stats.py
from typing import Optional, Union, List from dataclasses import dataclass from datetime import datetime import statistics from bs4 import BeautifulSoup import regex from .consts import ZWSP, WORD_JOINER, OMITTING @dataclass(frozen=True) class ThreadStats: id: int created_at: datetime is_new: bool ...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,106
FToovvr/adnmb-quests-watcher
refs/heads/master
/models/activity.py
from typing import Optional, List from dataclasses import dataclass, field import logging from datetime import datetime import psycopg2 import anobbsclient @dataclass class TotalBandwidthUsage: usages: List[anobbsclient.BandwidthUsage] = field(default_factory=list) def add(self, new_usage: anobbsclient.Ba...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,107
FToovvr/adnmb-quests-watcher
refs/heads/master
/db/migrate.py
#!/usr/bin/env python3 from typing import Optional import sys import json import sqlite3 import psycopg2 import psycopg2.extras from datetime import datetime, date from dateutil import tz import sys sys.path.append("..") # noqa from models.publication_record import PublicationRecord from models.activity import A...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,108
FToovvr/adnmb-quests-watcher
refs/heads/master
/models/analyzing.py
from typing import Optional, Union, Tuple, List, Dict, OrderedDict from dataclasses import dataclass from datetime import datetime, timedelta, date from bs4 import BeautifulSoup import psycopg2 import anobbsclient import sys sys.path.append("..") # noqa # pylint: disable=import-error from commons.consts import lo...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,109
FToovvr/adnmb-quests-watcher
refs/heads/master
/models/collecting.py
from typing import Any, Optional, List, Dict from dataclasses import dataclass, field import logging from datetime import datetime, timedelta import json import traceback import psycopg2 import psycopg2.extras import anobbsclient import sys sys.path.append("..") # noqa # pylint: disable=import-error from common...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,110
FToovvr/adnmb-quests-watcher
refs/heads/master
/db/_test_remove_contents_spaces.py
#!/usr/bin/env python3 import re import psycopg2 from bs4 import BeautifulSoup def main(): with open('password.secret', 'r') as password_file: password = password_file.read().strip() conn: psycopg2._psycopg.connection = psycopg2.connect( f'dbname=adnmb_qst_watcher user=postgres password={pas...
{"/0_tick.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/publication_record.py"], "/1_collect.py": ["/commons/consts.py", "/commons/config.py", "/models/activity.py", "/models/collecting.py"], "/fun/generate_wordcloud.py": ["/commons/consts.py", "/commons/config.py"], "/commons/includ...
52,133
ahmad-abdellatif/ChainerPruner
refs/heads/master
/chainerpruner/pruning/network_slimming/network_slimming.py
# Copyright (c) 2018 DeNA Co., Ltd. # Licensed under The MIT License [see LICENSE for details] from chainerpruner import Graph from chainerpruner.rebuild import rebuild from chainerpruner.masks import NormMask def pruning(model, args, target_conv_layers, threshold, default=None): """Apply mask and rebuild for Ne...
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,134
ahmad-abdellatif/ChainerPruner
refs/heads/master
/chainerpruner/rebuild/pytorch/modules/linear.py
# Copyright (c) 2018 DeNA Co., Ltd. # Licensed under The MIT License [see LICENSE for details] import torch import torch.nn as nn from chainerpruner.rebuild.rebuildlink import RebuildLink from chainerpruner.rebuild.utils import log_shape class RebuildLinear(RebuildLink): def passive_rebuild(self, linear, mask)...
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,135
ahmad-abdellatif/ChainerPruner
refs/heads/master
/tests/rebuild/pytorch/test_rebuild.py
import numpy as np from matplotlib import pyplot as plt import pytest from chainerpruner import Pruner, Graph from chainerpruner.masks import NormMask import torchvision.models as models import torch from torch import nn from torch.nn import functional as F enable_save = False def _test_model(tmpdir, model_class, x...
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,136
ahmad-abdellatif/ChainerPruner
refs/heads/master
/chainerpruner/pruning/network_slimming/pytorch.py
# Copyright (c) 2018 DeNA Co., Ltd. # Licensed under The MIT License [see LICENSE for details] import logging from torch import nn logger = logging.getLogger(__name__) class Lasso(): """Lasso regularization for PyTorch model.""" def __init__(self, model, rate, target_bn_layers=None): """Lasso regul...
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,137
ahmad-abdellatif/ChainerPruner
refs/heads/master
/chainerpruner/rebuild/pytorch/same_io_channels_layers.py
# Copyright (c) 2018 DeNA Co., Ltd. # Licensed under The MIT License [see LICENSE for details] import torch.nn as nn _disconnected_io_channels_layers = [ nn.Conv1d, nn.Conv2d, nn.Linear, nn.ConvTranspose1d, nn.ConvTranspose2d, ] def is_connected_io_channels(node): """Return True if the numb...
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,138
ahmad-abdellatif/ChainerPruner
refs/heads/master
/chainerpruner/pruning/psfp/chainer.py
# Copyright (c) 2018 DeNA Co., Ltd. # Licensed under The MIT License [see LICENSE for details] import chainer from chainer.training import extension from chainerpruner.pruning.psfp.psfp import ProgressiveSoftFilterPruning class ProgressiveSoftFilterPruningExtension(extension.Extension): name = 'ProgressiveSoftF...
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,139
ahmad-abdellatif/ChainerPruner
refs/heads/master
/chainerpruner/pruning/network_slimming/__init__.py
from chainerpruner.pruning.network_slimming.network_slimming import pruning
{"/chainerpruner/pruning/network_slimming/__init__.py": ["/chainerpruner/pruning/network_slimming/network_slimming.py"]}
52,158
dev216/opap
refs/heads/master
/opapmain.py
#!/usr/bin/python2.7 __author__ = 'nassos' import os import sys #import urllib.request import http.client import json import csv import time import random from progmenu import ProgramMenu from collections import OrderedDict # OPAP REST Services # {game} proto # {extension} json # http://applications.opap.gr/DrawsRes...
{"/opapmain.py": ["/progmenu.py"]}
52,159
dev216/opap
refs/heads/master
/progmenu.py
from xml.etree.ElementPath import _SelectorContext __author__ = 'nassos' class ProgramMenu: def __init__(self): self.options = { 0: "Get Last Draw", 1: "Update Draws", 2: "Print statistics"} self.options_count = len(self.options.keys()) def v...
{"/opapmain.py": ["/progmenu.py"]}
52,177
abolfazlvakily/django_resume_maker
refs/heads/master
/MySite/resume/views.py
from django.views.generic import ListView from .models import Skill class Resume(ListView): model = Skill
{"/MySite/resume/views.py": ["/MySite/resume/models.py"], "/MySite/resume/urls.py": ["/MySite/resume/views.py"], "/MySite/resume/models.py": ["/MySite/resume/enums.py"]}
52,178
abolfazlvakily/django_resume_maker
refs/heads/master
/MySite/resume/urls.py
from django.urls import path from .views import Resume from django.conf.urls.static import static from django.conf import settings app_name = 'resume' urlpatterns = [ path('', Resume.as_view(), name='skill_list'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
{"/MySite/resume/views.py": ["/MySite/resume/models.py"], "/MySite/resume/urls.py": ["/MySite/resume/views.py"], "/MySite/resume/models.py": ["/MySite/resume/enums.py"]}
52,179
abolfazlvakily/django_resume_maker
refs/heads/master
/MySite/resume/enums.py
from django.utils.translation import ugettext as _ class Priorities(object): High = 1 Medium = 2 Low = 3 PRIORITIES = ( (Priorities.High, _('High priority')), (Priorities.Medium, _('Medium priority')), (Priorities.Low, _('Low priority')) )
{"/MySite/resume/views.py": ["/MySite/resume/models.py"], "/MySite/resume/urls.py": ["/MySite/resume/views.py"], "/MySite/resume/models.py": ["/MySite/resume/enums.py"]}
52,180
abolfazlvakily/django_resume_maker
refs/heads/master
/MySite/resume/models.py
from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from ckeditor.fields import RichTextField from .enums import Priorities, PRIORITIES class Skill(models.Model): # هرکاربر سیستمی می تواند چندین مهارت داشته باشد user_id = models.ForeignKe...
{"/MySite/resume/views.py": ["/MySite/resume/models.py"], "/MySite/resume/urls.py": ["/MySite/resume/views.py"], "/MySite/resume/models.py": ["/MySite/resume/enums.py"]}
52,190
5l1v3r1/Discord-Nitro-Generator
refs/heads/main
/core/checker.py
import asyncio import aiohttp from aiohttp_socks import ProxyConnector from core.logging import Logging from typing import Tuple class Checker: def __init__(self) -> None: self.url = 'https://discord.com/api/v9/entitlements/gift-codes/%s?with_application=true&with_subscription_plan=true' async def ...
{"/core/checker.py": ["/core/logging.py"], "/main.py": ["/core/logging.py", "/core/checker.py", "/core/generator.py"]}
52,191
5l1v3r1/Discord-Nitro-Generator
refs/heads/main
/main.py
""" TODO: - socks4 / socks5 / http proxies support (only 4 for the moment) - send the code it to a webhook - remove dead proxies """ import itertools import asyncio import re from core.logging import Logging from core.checker import Checker from core.generator import Generator async def main(): Log...
{"/core/checker.py": ["/core/logging.py"], "/main.py": ["/core/logging.py", "/core/checker.py", "/core/generator.py"]}
52,192
5l1v3r1/Discord-Nitro-Generator
refs/heads/main
/core/generator.py
import string import random from typing import List class Generator: @staticmethod def generate(limit: int = 1000) -> List[str]: """ Generate (limit) potential nitro codes. """ codes = [] while len(codes) <= limit: code = ''.join(random.choices( string.as...
{"/core/checker.py": ["/core/logging.py"], "/main.py": ["/core/logging.py", "/core/checker.py", "/core/generator.py"]}
52,193
5l1v3r1/Discord-Nitro-Generator
refs/heads/main
/core/logging.py
from os import stat from rich.console import Console class Logging: console = Console() @staticmethod def print( content: str, prefix: str, prefix_color: str ) -> None: Logging.console.print( f'[{prefix_color}][{prefix}][/{prefix_color}] {content}' )...
{"/core/checker.py": ["/core/logging.py"], "/main.py": ["/core/logging.py", "/core/checker.py", "/core/generator.py"]}
52,217
Vianpyro/minecraft_with_python
refs/heads/main
/classes/datapack.py
from .workspace import Workspace from ..utilities.create_file import * from ..utilities.create_pack_meta import * from ..utilities.make_directory import * from shutil import rmtree from time import time import os data_types = ['advancements', 'dimension_type', 'dimension', 'item_modifiers‌', 'loot_tables', '...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,218
Vianpyro/minecraft_with_python
refs/heads/main
/__init__.py
# -*- coding: utf-8 -*- __version__ = "dev-1.0" __author__ = "Vianpyro" from .classes.datapack import * from .classes.workspace import * from .utilities.create_file import * from .utilities.create_pack_meta import * from .utilities.import_from_file import * from .utilities.make_directory import *
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,219
Vianpyro/minecraft_with_python
refs/heads/main
/utilities/create_pack_meta.py
def create_pack_meta(minecraft_version: str = '1.6.1', description: str = None, author: str = None) -> str: ''' This function helps with creating the string of a "pack.mcmeta" file ready to be written. :param minecraft_version: The version of Minecraft in which the user's server runs. :param...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,220
Vianpyro/minecraft_with_python
refs/heads/main
/utilities/create_file.py
def create_file(name, path:str='', content:(str, list, dict)='') -> None: ''' This functions creates a file. :param name: The name of the file to create. :param path: The path where the file has to be created. :param content: The content to write in the created file. :return: ...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,221
Vianpyro/minecraft_with_python
refs/heads/main
/tests.py
import minecraft_with_python as mcwpy import unittest import os class Tests(unittest.TestCase): def test_class_datapack_path(self): # Check that the path always ends with a path separator ("/") or nothing ("") self.assertEqual(mcwpy.Datapack(path='').path, '') self.assertEqual(mcwpy...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,222
Vianpyro/minecraft_with_python
refs/heads/main
/utilities/import_from_file.py
def import_from_file(path, extension='mcfunction') -> (str, None): ''' This functions help with importing files instead of writing them. The files has to exist on the user's computer to be imported. :param path: The path where the resource has to be find. :param extension: The extens...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,223
Vianpyro/minecraft_with_python
refs/heads/main
/classes/workspace.py
import warnings data_types = ['advancements', 'dimension_type', 'dimension', 'item_modifiers‌', 'loot_tables', 'functions', 'predicates', 'recipes'] class Workspace(): """ A Workspace is where the content of the Datapack will be written. A Datapack may countain several Workspaces. """ ...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,224
Vianpyro/minecraft_with_python
refs/heads/main
/utilities/make_directory.py
import os def make_directory(name, path: str='') -> None: """ This functions creates a directory. :param name: The name of the directory to create. :param path: The path where the directory has to be created. :return: None or OS-Error if the directory could not be created. ...
{"/classes/datapack.py": ["/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/make_directory.py"], "/__init__.py": ["/classes/datapack.py", "/classes/workspace.py", "/utilities/create_file.py", "/utilities/create_pack_meta.py", "/utilities/import_from_file.py", "/utilitie...
52,227
siddharth-rawal/django-proof
refs/heads/master
/myapp/models.py
from django.contrib.auth.models import User from django.db import models import os from django.conf import settings def user_profile_image_path( instance, filename ): return os.path.join( settings.STATIC_URL) class UserProfile(models.Model): user = models.OneToOneField(User) address = models.CharField(ma...
{"/myapp/views.py": ["/myapp/models.py"], "/myapp/url.py": ["/myapp/forms.py"], "/myapp/forms.py": ["/myapp/models.py"]}
52,228
siddharth-rawal/django-proof
refs/heads/master
/myapp/views.py
from django.shortcuts import get_object_or_404, redirect, render, render_to_response from django.http import HttpResponseRedirect from django.conf import settings from forms import RegistrationForm, UpdateUserModelFields, UpdateUserProfileModelFields from django.contrib import messages from django.contrib.auth.decorato...
{"/myapp/views.py": ["/myapp/models.py"], "/myapp/url.py": ["/myapp/forms.py"], "/myapp/forms.py": ["/myapp/models.py"]}
52,229
siddharth-rawal/django-proof
refs/heads/master
/myapp/url.py
from django.conf.urls import patterns, include, url from django.contrib.auth import views from django.contrib import admin from myapp.forms import LoginForm from django.views.generic.edit import CreateView from django.contrib.auth.forms import UserCreationForm urlpatterns = patterns('', #url(r'...
{"/myapp/views.py": ["/myapp/models.py"], "/myapp/url.py": ["/myapp/forms.py"], "/myapp/forms.py": ["/myapp/models.py"]}
52,230
siddharth-rawal/django-proof
refs/heads/master
/myapp/forms.py
from django import forms from django.contrib.auth.models import User from myapp.models import UserProfile from django.contrib.auth.forms import AuthenticationForm #from django.views.generic.edit import CreateView from django.contrib.auth.forms import UserCreationForm from django.http import HttpResponseRedirect #class...
{"/myapp/views.py": ["/myapp/models.py"], "/myapp/url.py": ["/myapp/forms.py"], "/myapp/forms.py": ["/myapp/models.py"]}
52,241
techpool/skfgi_notifier
refs/heads/master
/server.py
# Let's get this party started! import falcon import scrap import json import migrate import clock from query import query, querytojson # Falcon follows the REST architectural style, meaning (among # other things) that you think in terms of resources and state # transitions, which map to HTTP verbs. class Notification...
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,242
techpool/skfgi_notifier
refs/heads/master
/scrap.py
import requests import sqlite3 import datetime import json import db.dbconnect as dbconnector from bs4 import BeautifulSoup def scrap(): new_notice = 0 new_notice_list = [] # Creating the database connection conn = dbconnector.connect() # Creating the cursor object c = conn.cursor() # The root link for the...
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,243
techpool/skfgi_notifier
refs/heads/master
/query/querytojson.py
import json import query def json_wrapper(query_obj): data = [] for query_tuble in query_obj: json_obj = { "heading": str(query_tuble[0]), "sub_heading": str(query_tuble[1]), "url": str(query_tuble[2]), "update_time": str(query_tuble[3]) } data.append(json_obj) data = json.dumps(data) return dat...
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,244
techpool/skfgi_notifier
refs/heads/master
/db/dbconnect.py
import sqlite3 DB_NAME = 'skfgi.db' connection = sqlite3.connect(DB_NAME) def connect(): return connection
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,245
techpool/skfgi_notifier
refs/heads/master
/query/query.py
import sqlite3 import db.dbconnect as dbconnector import json def get_all_notice(): connection = dbconnector.connect() cursor = connection.cursor() result = cursor.execute('SELECT * FROM notification') return result def get_recent_notice(): connection = dbconnector.connect() cursor = connection.cursor() re...
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,246
techpool/skfgi_notifier
refs/heads/master
/clock.py
import time import requests import threading def scrap_call(): while True: try: requests.post('http://skfginotifier.herokuapp.com/scrap', timeout=40) except requests.exceptions.ReadTimeout as e: print(e) finally: time.sleep(180) t = threading.Thread(target=scrap_call) t.daemon = True t.start()
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,247
techpool/skfgi_notifier
refs/heads/master
/migrate.py
import sqlite3 import json import db.dbconnect as dbconnector def drop_table(): conn = dbconnector.connect() cursor = conn.cursor() json_data = {} try: cursor.execute('''DROP TABLE notification''') json_data['status'] = "sucess" except sqlite3.OperationalError as e: json_data['status'] = "error" json_da...
{"/server.py": ["/scrap.py", "/migrate.py", "/clock.py"], "/scrap.py": ["/db/dbconnect.py"], "/query/query.py": ["/db/dbconnect.py"], "/migrate.py": ["/db/dbconnect.py"]}
52,248
zengdz/crimemap
refs/heads/master
/mockdbhelper.py
class MockDBHelper: def connect(self, database="crimemap"): pass def get_all_inputs(self): return [] def add_input(self, data): pass def clear_all(self): pass def add_record(self, category, date, latitude, longitude, description): pass def get_all_records(self): return [{ 'latitude': 23.1157, 'lon...
{"/crimemap.py": ["/mockdbhelper.py", "/dbhelper.py"]}
52,249
zengdz/crimemap
refs/heads/master
/dbhelper.py
#coding: utf-8 import pymysql import dbconfig import datetime #所有的数据操作都放在try-finally里面,以便数据库最终都能顺利关闭连接 class DBHelper: #数据库连接,每次操作数据表格前都要连接,末尾指定编码 def connect(self, database="crimemap"): return pymysql.connect(host='localhost', user=dbconfig.db_user, passwd=dbconfig.db_password, db=database, charset...
{"/crimemap.py": ["/mockdbhelper.py", "/dbhelper.py"]}
52,250
zengdz/crimemap
refs/heads/master
/crimemap.py
#coding:utf-8 #服务器使用的是Python2,代码里含有中文时需要指明程序文件的编码 from flask import Flask from flask import render_template from flask import request import json #注意dbconfig没有加入版本管理,本地的dbconfig只有一句 test = True #服务器端的dbconfig除了有test = False,还有数据库的凭证 import dbconfig if dbconfig.test: from mockdbhelper import MockDBHelper as DBHelper e...
{"/crimemap.py": ["/mockdbhelper.py", "/dbhelper.py"]}
52,255
kicon/armstrong.dev
refs/heads/master
/armstrong/dev/tests/utils/__init__.py
from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from armstrong.dev.tests.utils.base import ArmstrongTestCase, override_settings
{"/armstrong/dev/tests/utils/__init__.py": ["/armstrong/dev/tests/utils/base.py"], "/armstrong/dev/virtualdjango/test_runner.py": ["/armstrong/dev/virtualdjango/base.py"], "/armstrong/dev/tests/utils/users.py": ["/armstrong/dev/tests/utils/base.py"]}