index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
45,095 | valisfree/rainreader_v1 | refs/heads/master | /func.py | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------
# Name: Rain.reader
# Created: 09.11.2018
# Version: 0.1
# Copyright: (c) 2018, Vale_Phtor, valisfree@yandex.ru phtor.ru
# Licence: Apache License version 2.0
#------------------------------------------... | {"/main.py": ["/func.py"]} |
45,096 | valisfree/rainreader_v1 | refs/heads/master | /main.py | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: Rain.reader
# Created: 09.11.2018
# Version: 0.1
# Copyright: (c) 2018, Vale_Phtor, valisfree@yandex.ru phtor.ru
# Licence: Apache License version 2.0
#----------------------------------... | {"/main.py": ["/func.py"]} |
45,098 | CHALASS770/WOG | refs/heads/master | /e2e.py | from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from time import sleep
from selenium.webdriver.chrome.options import Options
print("test")
def test_score_webservice():
print(1)
Url = "http://127.0.0.1:8777"
print(3)
chrome_options = Options()... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,099 | CHALASS770/WOG | refs/heads/master | /GuessGame.py | from random import *
class GuessGame :
def __init__(self):
self.secretNumber = 1
self.difficulty= -1
self.chance=5
def generat_number(self, difficulty):
self.secretNumber = int(randint(0, difficulty*10))
self.chance=self.chance+1-difficulty
def get_secre... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,100 | CHALASS770/WOG | refs/heads/master | /MainGame.py | from live import *
from Scores import *
from MainScore import *
name = input("whats your name ?")
welcome(name)
while True:
play, level = load_game()
play_game(play,level)
Score = Scores(name, play ,level)
Score.Write_Score()
want=input('do you want play again ? y/n')
if want == 'n'... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,101 | CHALASS770/WOG | refs/heads/master | /Utils.py |
class Utils :
def __init__(self, namePlayer, play ,myscore):
self.score_file_name = ""
self.bad_return_code = -1
self.chance=5
self.score=myscore
self.nameplay = namePlayer
if play == 1:
self.play = "Memorygame"
elif play == 2:
... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,102 | CHALASS770/WOG | refs/heads/master | /Scores.py | from Utils import *
class Scores :
def __init__(self ,nameP, play, difficult) :
self.score = 0
self.diffic = difficult
self.namep = nameP
self.Play = play
self.newscore = 0
def Write_Score(self):
self.score = self.diffic * 3 + 5
self.score = st... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,103 | CHALASS770/WOG | refs/heads/master | /MemoryGame.py | from random import *
from time import sleep
class MemoryGame :
def __init__(self, difficult):
self.my_sequence = []
self.list_from_user = []
self.difficulty = difficult*2
#self.valid=0
def generate_sequence(self):
for lenght in range(self.difficulty):
... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,104 | CHALASS770/WOG | refs/heads/master | /CurrencyRouletteGame.py | from random import *
from time import sleep
class CurrencyRouletteGame:
def __init__(self, difficult):
self.total_money = int(randint(5,1000))
self.intermin = 0
self.intermax = 0
self.difficult = difficult
self.useramount = 0
def get_money_interval(self):
... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,105 | CHALASS770/WOG | refs/heads/master | /live.py | from GuessGame import *
from time import sleep
from MemoryGame import *
from CurrencyRouletteGame import *
def welcome(name):
print("Hello %s ! Welcome in World of Game!!! "% name)
print("Here you can find many cool games to play ")
def load_game():
valideplay = True
while valideplay == True:... | {"/MainGame.py": ["/live.py", "/Scores.py"], "/Scores.py": ["/Utils.py"], "/live.py": ["/GuessGame.py", "/MemoryGame.py", "/CurrencyRouletteGame.py"]} |
45,106 | NotAnonymous33/gameOfLife | refs/heads/master | /game.py | class Game:
def next_cells(self, cells):
new_cells = cells
grid = [(len(cells) + 2) * [0]] + [[0] + [abs(int(cell.on)) for cell in row] + [0] for row in cells] + [
(len(cells) + 2) * [0]]
grid = self.next_grid(grid)
for row_num in range(len(cells)):
for col_nu... | {"/main.py": ["/game.py"]} |
45,107 | NotAnonymous33/gameOfLife | refs/heads/master | /main.py | import pygame
from game import Game
import random
game = Game()
length = 20 # pixels across of each cell
num_rows = 40
border = 2
grey = (30, 30, 30)
white = (255, 255, 255)
black = (0, 0, 0)
green = (0, 255, 0)
class Cell:
def __init__(self, x, y, window):
self.x = x
self.y = y
self.on ... | {"/main.py": ["/game.py"]} |
45,108 | realzhengyiming/WeatherPlatform | refs/heads/main | /weather_cralwer/weather_cralwer/db_util.py | # read_all_city_and_city_code from databases;
# 导入pymysql模块
from typing import List
import pymysql
from WeatherWeb.WeatherWeb.settings import DATABASES
import pymysql
from dbutils.pooled_db import PooledDB
import logging
logger = logging.getLogger(__name__)
class MysqlSimipleConn:
def __init__(self):
... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,109 | realzhengyiming/WeatherPlatform | refs/heads/main | /weather_cralwer/weather_cralwer/spiders/today_weather_spider.py | import datetime
import json
import time
from typing import List
import scrapy
from weather_cralwer.weather_cralwer.clean_util import temperature_process, aqi_process
from weather_cralwer.weather_cralwer.db_util import mysql_conn_instance # todo 修好这个东西 找不到爬虫的问题
from weather_cralwer.weather_cralwer.items import DateWe... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,110 | realzhengyiming/WeatherPlatform | refs/heads/main | /init_db/init_city.py | import sys
import os
from xpinyin import Pinyin
base_dir = '/root/new_tmp_job/WeatherPlatform'
sys.path.append(base_dir)
from init_db.city_lists import CITY_LIST
from init_db.mysql_coon import mysql_conn
from init_db.new_city_code import city_and_code
def get_city_and_city_pinyin():
city_list = []
with ope... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,111 | realzhengyiming/WeatherPlatform | refs/heads/main | /scrapy_main.py | from scrapy.cmdline import execute
execute("scrapy crawl today_weather".split())
| {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,112 | realzhengyiming/WeatherPlatform | refs/heads/main | /spider_schedule.py | # 写一个简单的定时任务,让爬虫自动启动吧
import datetime
import subprocess
import time
import schedule
from scrapy.cmdline import execute
def spider_schedule_job():
# 启动爬虫呢
print(f"爬虫已启动,启动时间{datetime.datetime.now()}")
# execute("scrapy crawl today_weather".split()) # 这样好像是不行的
cmdline = '''
cd /root/new_tmp_job/We... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,113 | realzhengyiming/WeatherPlatform | refs/heads/main | /weather_cralwer/weather_cralwer/spiders/today_one_city_weather_spider.py | import datetime
import json
import time
from typing import List
import scrapy
from weather_cralwer.weather_cralwer.clean_util import temperature_process, aqi_process
from weather_cralwer.weather_cralwer.items import DateWeatherItem, HourWeatherItem
class ChinaOneWeatherSpider(scrapy.Spider):
name = 'baidu'
... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,114 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/analysis/graph_api_view.py | # 怎么弄出一个统一的接口呢,或者就弄一个统一的打包装饰器
import json
from django.http import HttpResponse
from rest_framework.views import APIView
from analysis.graph_view import bar_base, GeoMap
def response_as_json(data):
json_str = json.dumps(data)
response = HttpResponse(
json_str,
content_type="application/json"... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,115 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/drawviews.py | import datetime
import json
import time
import numpy as np
import pandas as pd
from django.core.cache import cache # 导入缓存对象,redis存储
from django.db import connection
from django.db.models import Count # 直接使用models中的统计类来进行统计查询操作
from django.http import HttpResponse
from pyecharts import options as opts
from pyecharts.... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,116 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/templatetags/city_tags.py | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: city_tags
Description :
Author : zhengyimiing
date: 2020/4/28
-------------------------------------------------
Change Activity:
2020/4/28
----------------------------... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,117 | realzhengyiming/WeatherPlatform | refs/heads/main | /weather_cralwer/weather_cralwer/clean_util.py | def temperature_process(valid_temperature: str) -> float:
valid_temperature = valid_temperature.replace("℃", "")
return float(valid_temperature)
def aqi_process(valid_aqi: str) -> float:
if not valid_aqi:
return 0.0
else:
return float(valid_aqi)
| {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,118 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/kmeans_process.py | # 这个是进行无监督聚类处理的东西
import datetime
import pandas as pd
from sklearn.cluster import KMeans
from weather_show_app.models import City, DateWeather
def one_hot_col_process(df, col_name): # 对分类变量做one-hot处理
one_hot_cols = pd.get_dummies(df[col_name])
df = df.join(one_hot_cols)
df = df.drop(col_name, axis=1)
... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,119 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/analysis/views.py | from django.shortcuts import render
# geo graph
from pyecharts import options as opts
from pyecharts.charts import Geo
from pyecharts.datasets import register_url
# 做这个前后端分离的步骤是:
# 1. 思考,选好大概要用什么可视化的图
# 2. 然后是查看官方文档,复制下源代码
# 2.1 首先是按照官方的。把 对象创建好,比如bar(),然后统一用jsonResponse 装好。
# 2.2 然后是创建好url的映射这个接口的路径和name
# 2。3 然后前端... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,120 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/models.py | from datetime import date
from django.contrib.auth.models import User
from django.db import models
class DateWeather(models.Model): # 天气概括表 todo 敲里吗,调试一点都不好用!!!!!!!我
class Meta:
db_table = 'DateWeather'
unique_together = ("date", "city")
dressing_index = models.CharField(default="", max_len... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,121 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/forms.py | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: forms
Description :
Author : zhengyimiing
date: 2020/3/26
-------------------------------------------------
Change Activity:
2020/3/26
--------------------------------... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,122 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/views.py | import datetime
import json
import pandas as pd
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # 用来分页饿
from django.db import conne... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,123 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/analysis/graph_view.py | from random import randrange
from pyecharts import options as opts
from pyecharts.charts import Bar, Geo
from pyecharts.datasets import register_url
def bar_base() -> Bar:
c = (
Bar()
.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
.add_yaxis("商家A", [randrange(0, 100) for _ in... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,124 | realzhengyiming/WeatherPlatform | refs/heads/main | /init_db/fill_province.py | # 用来填充 城市所属省份的
import json
import pandas as pd
import requests
from init_db.mysql_coon import mysql_conn
gaode = pd.read_excel("AMap_adcode_citycode_20210406.xlsx")
def find_province_by_city_code(city_code):
city_code = str(city_code)
for index, row in gaode.iterrows():
name = row[0]
code =... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,125 | realzhengyiming/WeatherPlatform | refs/heads/main | /init_db/mysql_coon.py | import pymysql
config = {
"host": "127.0.0.1", # 地址
"port": 3306, # 端口
"user": "root", # 用户名
"password": "123456", # 密码
"database": "scrapy_django", # 数据库名;如果通过Python操作MySQL,要指定需要操作的数据库
"charset": "utf8mb4"
}
mysql_conn = pymysql.connect(**config)
| {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,126 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/analysis/constant/enums.py | # 这儿放各个api图表的
| {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,127 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/urls.py | # -*- coding: utf-8 -*-
from django.contrib.auth import views as auth_views
from django.urls import path
from weather_show_app import views, drawviews
app_name = "weather_show_app" # 这儿需要设置这个来分辨不同的app
urlpatterns = [ # todo 记得要删除这些坏东西/
path("index/", views.index, name="index"),
path("", views.index, name=... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,128 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/constant.py | # 出行指南
WALK_OUT_GUIDE_DICT = {
'阴': "阴天,可能下雨,出行带伞",
'雾': "出行请注意安全,保持距离",
'小雨': '出行请带伞',
'多云': '天气多云,适合外出',
'晴': "天气晴朗,适合出行,出行请做好防晒",
'中雨': '出行请带好伞',
'雨夹雪': "出行注意安全,保湿距离",
'大雨': "大雨视野受限,请减慢速度行驶",
'小雪': '视情况而定,可以带伞',
'阵雨': '出行请带伞',
'雷阵雨': "出行请带伞",
'中雪': "请带伞,并且注意行车速度",
... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,129 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/analysis/urls.py | from django.conf.urls import url
from . import views, graph_api_view
# 上面是api 的映射,下面是页面的url的映射,采用前后端分离的操作进行开发。
urlpatterns = [
url(r'^bar/$', graph_api_view.BarView.as_view(), name='demo'),
url(r'^geo/$', graph_api_view.GeoView.as_view(), name="geo"),
] + [
... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,130 | realzhengyiming/WeatherPlatform | refs/heads/main | /weather_cralwer/weather_cralwer/items.py | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
from scrapy import Item, Field
from scrapy_djangoitem import DjangoItem
from weather_show_app.models import DateWeather, HourWeather, Favourite, City
class DateWeatherItem(DjangoItem):
... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,131 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/admin.py | from django.contrib import admin
from weather_show_app.models import City
from weather_show_app.models import DateWeather
from weather_show_app.models import Favourite
class ExtendCity(admin.ModelAdmin):
search_fields = ("name", "pinyin", "code") # 搜索字段
list_display = ('id', 'name', 'pinyin', 'code',)
cla... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,132 | realzhengyiming/WeatherPlatform | refs/heads/main | /init_db/fill_province_test.py | from init_db.fill_province import get_province_by_gaode, get_location_by_gaode
if __name__ == '__main__':
# result = get_province_by_gaode("北京")
# print(result)
result = get_location_by_gaode("扬州")
print(result) | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,133 | realzhengyiming/WeatherPlatform | refs/heads/main | /WeatherWeb/weather_show_app/apps.py | from django.apps import AppConfig
class WeatherShowAppConfig(AppConfig):
name = 'weather_show_app'
| {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,134 | realzhengyiming/WeatherPlatform | refs/heads/main | /weather_cralwer/weather_cralwer/pipelines.py | import django
from weather_cralwer.weather_cralwer.items import DateWeather, DateWeatherItem
from weather_show_app.models import City, HourWeather # 改成才可以,什么鬼》》。。 todo
class DateWeatherPipeline:
def insert_hour_weather(self, spider, item,weather): # check hour weather exist
belong_to_date = item['belon... | {"/weather_cralwer/weather_cralwer/spiders/today_weather_spider.py": ["/weather_cralwer/weather_cralwer/clean_util.py", "/weather_cralwer/weather_cralwer/db_util.py", "/weather_cralwer/weather_cralwer/items.py"], "/init_db/init_city.py": ["/init_db/mysql_coon.py"], "/weather_cralwer/weather_cralwer/spiders/today_one_ci... |
45,136 | ergo/Python_RPG | refs/heads/master | /warriors.py | # Some heroes
# A way to perform automatic fight sequence until one of heroes is dead
# Heroes may want to have some very basic stats (health, agility, strength) and skills (dodge, block)
# Heroes may want to be able to use some items that influence stats
# Jakies cos
from random import randint
import sy... | {"/Walka.py": ["/warriors.py"]} |
45,137 | ergo/Python_RPG | refs/heads/master | /Walka.py | # -*- coding: utf-8 -*-
# Some heroes
# A way to perform automatic fight sequence until one of heroes is dead
# Heroes may want to have some very basic stats (health, agility, strength) and skills (dodge, block)
# Heroes may want to be able to use some items that influence stats
from warriors import Warrio... | {"/Walka.py": ["/warriors.py"]} |
45,147 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/books/views.py | from flask import jsonify, request
from flask_jwt_extended import jwt_required, get_jwt_identity
from api.models import Book, User, BorrowingHistory, datetime, timedelta
from . import book
from api.decorators import allow_pagination
@book.route('/api/v2/books', methods=['GET'])
@allow_pagination
def get_all_books():... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,148 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/errors/handlers.py | from flask import jsonify
from . import errors
from api import jwt, RevokedTokens
@errors.app_errorhandler(404)
def error_404(e):
return jsonify({"message": "The resource you are looking for " +
"does not exist."}), 404
@errors.app_errorhandler(400)
def error_400(e):
return j... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,149 | brian-mecha/hello-books | refs/heads/challenge_3 | /config.py | import os
class Config(object):
"""
General Config settings that are shared by all environments
"""
DEBUG = False
TESTING = False
ERROR_404_HELP = False
# SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:mozart@localhost:5432/hello_books'
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_UR... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,150 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/users/views.py | import re
from flask import jsonify, request
from flask_jwt_extended import create_access_token, get_raw_jwt, get_jwt_identity, jwt_required
from api.models import User, ActiveTokens, RevokedTokens, db, check_password_hash, generate_password_hash
from . import user
@user.route('/api/v2/auth/register', methods=['POS... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,151 | brian-mecha/hello-books | refs/heads/challenge_3 | /tests/test_admin.py | import unittest
import json
from api import create_app, db
class AdminTestCase(unittest.TestCase):
"""
Tests for all the admin user checkpoints
"""
def setUp(self):
"""
Defines the test variables and initializes the Book api
:return:
"""
self.app = create_app(c... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,152 | brian-mecha/hello-books | refs/heads/challenge_3 | /tests/test_users.py | import unittest
import json
from api import create_app, db
class UserTestCase(unittest.TestCase):
"""
Tests for all the user API endpoints
"""
def setUp(self):
"""
Defines the test variables and initializes the User api
:return:
"""
self.app = create_app(conf... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,153 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/books/__init__.py | from flask import Blueprint
book = Blueprint('books', __name__)
from . import views
| {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,154 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/admin/views.py | from flask import jsonify, request
from jsonschema import validate
from flask_jwt_extended import get_raw_jwt, get_jwt_identity, jwt_required
from api.models import User, Book, RevokedTokens
from . import admin
from api.models import db
from api.decorators import admin_user
# def verify_token_and_if_user_is_admin():... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,155 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/decorators.py | import json
from functools import wraps
from flask import request, jsonify
from .models import get_paginated, User
from flask_jwt_extended import get_jwt_identity
def allow_pagination(func):
"""
Decorator for paginating results
:param func:
:return:
"""
@wraps(func)
def paginate(*args, **... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,156 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/models.py | """
Contains models used in our apps.
"""
from werkzeug.security import check_password_hash, generate_password_hash
from datetime import datetime, timedelta
from flask_sqlalchemy import SQLAlchemy
from math import ceil
from sqlalchemy import desc
# Initializes Database
db = SQLAlchemy()
class User(db.Model):
"""... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,157 | brian-mecha/hello-books | refs/heads/challenge_3 | /tests/test_books.py | import unittest
import json
from api import create_app, db
from tests.test_users import UserTestCase
from tests.test_admin import AdminTestCase
class BookTestCase(unittest.TestCase):
"""
Tests for all the books endpoints
"""
def setUp(self):
"""
Defines the test variables and initiali... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,158 | brian-mecha/hello-books | refs/heads/challenge_3 | /api/__init__.py | from flask_api import FlaskAPI
from flask_login import LoginManager
from flask_jwt_extended import JWTManager
from api.models import RevokedTokens, db
from flask_cors import CORS
from config import config_app
login_manager = LoginManager()
jwt = JWTManager()
def create_app(config_name):
app = FlaskAPI(__name__,... | {"/api/books/views.py": ["/api/models.py", "/api/books/__init__.py", "/api/decorators.py"], "/api/errors/handlers.py": ["/api/__init__.py"], "/api/users/views.py": ["/api/models.py"], "/tests/test_admin.py": ["/api/__init__.py"], "/tests/test_users.py": ["/api/__init__.py"], "/api/admin/views.py": ["/api/models.py", "/... |
45,160 | hqwisen/django-oauth2-login-client | refs/heads/master | /oauth2_login_client/utils.py | from django.conf import settings
from requests_oauthlib.oauth2_session import OAuth2Session
def oauth_session(token=None):
return OAuth2Session(
settings.OAUTH_CLIENT_ID,
redirect_uri=settings.OAUTH_CALLBACK_URL,
auto_refresh_url=settings.OAUTH_SERVER + settings.OAUTH_TOKEN_URL,
tok... | {"/oauth2_login_client/backends.py": ["/oauth2_login_client/utils.py"]} |
45,161 | hqwisen/django-oauth2-login-client | refs/heads/master | /oauth2_login_client/backends.py | import logging
import json
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from .models import RemoteUser
from .utils import oauth_session, sync_user
class OAuthBackend(ModelBackend):
def authenticate(self, code=None):
... | {"/oauth2_login_client/backends.py": ["/oauth2_login_client/utils.py"]} |
45,162 | Chriz4/prepabrik | refs/heads/master | /prepabrik/urls.py |
from django.contrib import admin
from django.urls import path
from .views import home_page
from produksi.views import (
produksi_list,
tambah_barang
)
from penjualan.views import (penjualan_list, TransactionCreate )
urlpatterns = [
path('', home_page),
path('produksi/', produksi_list, name='pr... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,163 | Chriz4/prepabrik | refs/heads/master | /penjualan/views.py | from django.shortcuts import render
from django.views.generic import CreateView
from .models import Transaksi
# Create your views here.
def penjualan_list(request):
template_name = "penjualan/penjualan-list.html"
qs = Transaksi.objects.all()
context = { "page_title": "Log Transaksi", "object_list": qs }
... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,164 | Chriz4/prepabrik | refs/heads/master | /produksi/migrations/0006_auto_20190625_2116.py | # Generated by Django 2.2 on 2019-06-25 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('produksi', '0005_auto_20190618_1637'),
]
operations = [
migrations.AlterField(
model_name='logbarang',
name='waktu',
... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,165 | Chriz4/prepabrik | refs/heads/master | /produksi/migrations/0004_auto_20190618_1624.py | # Generated by Django 2.2 on 2019-06-18 09:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('produksi', '0003_auto_20190618_1623'),
]
operations = [
migrations.AlterField(
model_name='listbarang',
name='waktu',
... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,166 | Chriz4/prepabrik | refs/heads/master | /produksi/migrations/0005_auto_20190618_1637.py | # Generated by Django 2.2 on 2019-06-18 09:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('produksi', '0004_auto_20190618_1624'),
]
operations = [
migrations.RemoveField(
model_name='listb... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,167 | Chriz4/prepabrik | refs/heads/master | /produksi/admin.py | from django.contrib import admin
from .models import ListBarang, LogBarang
# Register your models here.
admin.site.register(ListBarang)
admin.site.register(LogBarang)
| {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,168 | Chriz4/prepabrik | refs/heads/master | /produksi/views.py | from django.shortcuts import render, redirect
from django.db.models import Sum
from .models import LogBarang, ListBarang
from .forms import LogBarangModelForm
import datetime
# Create your views here.
def produksi_list(request):
template_name = "produksi/list-produksi.html"
log_barang = LogBarang.objects.all... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,169 | Chriz4/prepabrik | refs/heads/master | /penjualan/admin.py | from django.contrib import admin
from .models import DaftarBarang, Transaksi
# Register your models here.
admin.site.register(DaftarBarang)
admin.site.register(Transaksi) | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,170 | Chriz4/prepabrik | refs/heads/master | /produksi/models.py | from django.db import models
# import datetime
# Create your models here.
class ListBarang(models.Model):
nama = models.TextField(max_length=30)
def __str__(self):
return self.nama
class LogBarang(models.Model):
# now = datetime.datetime.now()
barang = models.ForeignKey(
ListBarang, o... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,171 | Chriz4/prepabrik | refs/heads/master | /penjualan/migrations/0003_auto_20190703_1003.py | # Generated by Django 2.2 on 2019-07-03 03:03
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('penjualan', '0002_auto_20190627_1943'),
]
operations = [
migrations.AlterField(
model_name='transaksi... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,172 | Chriz4/prepabrik | refs/heads/master | /prepabrik/views.py | from django.http import HttpResponse
from django.shortcuts import render
from produksi.models import LogBarang
def home_page(request):
ls = LogBarang.objects.all()[:3]
title = 'Sistem Informasi Pabrik'
template_name = "home.html"
context = {"title": title,'list_barang':ls}
return render(request, t... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,173 | Chriz4/prepabrik | refs/heads/master | /produksi/forms.py | from django import forms
from .models import LogBarang
class LogBarangModelForm(forms.ModelForm):
# barang = forms.ChoiceField(widget=Select)
class Meta:
model = LogBarang
fields = ['barang', 'jumlah']
def __init__(self, *args, **kwargs):
super(LogBarangModelForm, self).... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,174 | Chriz4/prepabrik | refs/heads/master | /penjualan/models.py | from django.db import models
from django.utils import timezone
from django.urls import reverse
# Create your models here.
class DaftarBarang(models.Model):
nama = models.TextField(max_length=30)
harga = models.IntegerField()
def __str__(self):
return self.nama
class Transaksi(models.Model):
... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,175 | Chriz4/prepabrik | refs/heads/master | /produksi/migrations/0002_auto_20190618_1425.py | # Generated by Django 2.2 on 2019-06-18 07:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('produksi', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='listbarang',
name='jumlah',
... | {"/prepabrik/urls.py": ["/prepabrik/views.py", "/produksi/views.py", "/penjualan/views.py"], "/penjualan/views.py": ["/penjualan/models.py"], "/produksi/admin.py": ["/produksi/models.py"], "/produksi/views.py": ["/produksi/models.py", "/produksi/forms.py"], "/penjualan/admin.py": ["/penjualan/models.py"], "/prepabrik/v... |
45,229 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/fixtures_migration/models.py | from django.db import models
class Book(models.Model):
name = models.CharField(max_length=100)
| {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,230 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/utils_tests/test_timezone.py | import copy
import datetime
import pickle
import unittest
from django.test import override_settings
from django.utils import timezone
try:
import pytz
except ImportError:
pytz = None
if pytz is not None:
CET = pytz.timezone("Europe/Paris")
EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi
ICT... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,231 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/model_meta/test_legacy.py | import warnings
from django import test
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import FieldDoesNotExist
from django.db.models.fields import CharField, related
from django.utils.deprecation import RemovedInDjango110Warning
from .models import BasePerson, Person
from ... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,232 | MulticsYin/MulticsSH | refs/heads/master | /home/admin.py | #_*_ coding: utf-8 _*_
from django.contrib import admin
from .models import *
# Register your models heore.
# 两种方法建立数据库与后台的连接
# 本机登录http://127.0.0.1:8000/admin/即可访问后台,前提是使用python manage.py runserver.
# 若无管理员,在项目当前目录命令行下输入python manage.py createsuperuser新建管理员。
# 方法一:
class tb_userAdmin(admin.ModelAdmin):
list_displ... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,233 | MulticsYin/MulticsSH | refs/heads/master | /home/models.py | # _*_ coding: utf-8 _*_
# 模型主要与数据库的表项有关,每一个类对应数据库里的一个表。
# 每个表备注了使用的基本信息,更多详见开发文档《智能家居云平台实现》。
# 注:每个模型重定义的__str__或__unicode__返回值不能以id结尾,会报错。
# 在设计文档中命名表的变量和实际开发的有区别,具体是前面加了一个“sh_”,保证变量唯一。
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatib... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,234 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/app_loading/tests.py | from __future__ import unicode_literals
import os
import sys
import warnings
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.test import TestCase
from django.test.utils import extend_sys_path
from django.utils import six
from django.utils._... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,235 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/commands_sql/tests.py | from __future__ import unicode_literals
import re
import unittest
from django.apps import apps
from django.core.management.color import no_style
from django.core.management.sql import (
sql_all, sql_create, sql_delete, sql_destroy_indexes, sql_indexes,
)
from django.db import DEFAULT_DB_ALIAS, connections
from dj... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,236 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/shortcuts/tests.py | from django.test import TestCase, ignore_warnings, override_settings
from django.test.utils import require_jinja2
from django.utils.deprecation import RemovedInDjango110Warning
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(TestCase):
def test_render_to_response(self):
respo... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,237 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/template_tests/test_engine.py | import os
from django.template import Context
from django.template.engine import Engine
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from .utils import ROOT, TEMPLATE_DIR
OTHER_DIR = os.path.join(ROOT, 'other_templates')
@ignore_warnings(cat... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,238 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/template_tests/syntax_tests/test_i18n.py | # coding: utf-8
from __future__ import unicode_literals
from django.test import SimpleTestCase
from django.utils import translation
from django.utils.safestring import mark_safe
from ..utils import setup
class I18nTagTests(SimpleTestCase):
@setup({'i18n01': '{% load i18n %}{% trans \'xxxyyyxxx\' %}'})
def ... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,239 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/gis_tests/maps/tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.test import TestCase
from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text
GOOGLE_MAPS_API_KEY = 'XXXX'
@s... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,240 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/servers/test_basehttp.py | from django.core.handlers.wsgi import WSGIRequest
from django.core.servers.basehttp import WSGIRequestHandler
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import captured_stderr
from django.utils.six import BytesIO
class Stub(object):
def __init__(self, **k... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,241 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/template_backends/test_jinja2.py | # Since this package contains a "jinja2" directory, this is required to
# silence an ImportWarning warning on Python 2.
from __future__ import absolute_import
import sys
from unittest import skipIf
from .test_dummy import TemplateStringsTests
# Jinja2 doesn't run on Python 3.2 because it uses u-prefixed unicode stri... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,242 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/known_related_objects/tests.py | from __future__ import unicode_literals
from django.test import TestCase
from .models import Organiser, Pool, PoolStyle, Tournament
class ExistingRelatedInstancesTests(TestCase):
fixtures = ['tournament.json']
def test_foreign_key(self):
with self.assertNumQueries(2):
tournament = Tourn... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,243 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/migrations/test_base.py | import os
from django.db import connection
from django.db.migrations.recorder import MigrationRecorder
from django.test import TransactionTestCase
from django.utils._os import upath
class MigrationTestBase(TransactionTestCase):
"""
Contains an extended set of asserts for testing migrations and schema operati... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,244 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/template_backends/test_django.py | from template_tests.test_response import test_processor_name
from django.template import RequestContext
from django.template.backends.django import DjangoTemplates
from django.test import RequestFactory, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from .test_dummy import TemplateStr... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,245 | MulticsYin/MulticsSH | refs/heads/master | /SmartHome/urls.py | # _*_ coding: utf-8 _*_
"""SmartHome URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.ho... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,246 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/model_regress/test_pickle.py | import datetime
import os
import pickle
import subprocess
import sys
from django.core.files.temp import NamedTemporaryFile
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.test import TestCase, mock
from django.utils._os import npath, upath
from django.utils.version import get_version
from .models ... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,247 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/urlpatterns_reverse/included_namespace_urls.py | import warnings
from django.conf.urls import include, patterns, url
from django.utils.deprecation import RemovedInDjango110Warning
from .namespace_urls import URLObject
from .views import view_class_instance
testobj3 = URLObject('testapp', 'test-ns3')
# test deprecated patterns() function. convert to list of urls()... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,248 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/admin_validation/tests.py | from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, ignore_warnings
from django.test.utils import str_prefix
from django.utils.deprecation import RemovedInDjango19Warning
from .model... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,249 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/fixtures_migration/tests.py | from django.core import management
from django.test import TransactionTestCase
from .models import Book
class TestNoInitialDataLoading(TransactionTestCase):
"""
Apps with migrations should ignore initial data. This test can be removed
in Django 1.9 when migrations become required and initial data is no l... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,250 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/view_tests/tests/test_defaults.py | from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings
from ..models import UrlArticle
@override_settings(ROOT_URLCONF='view_tests.urls')
class DefaultsTests(TestCase):
"""Test django views in django/views/defaults.py"""
fixtures = ['testdata... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,251 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/db_functions/tests.py | from __future__ import unicode_literals
from unittest import skipUnless
from django.db import connection
from django.db.models import CharField, TextField, Value as V
from django.db.models.functions import (
Coalesce, Concat, ConcatPair, Length, Lower, Substr, Upper,
)
from django.test import TestCase
from django... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,252 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/admin_scripts/management/commands/validation_command.py | from django.core.management.base import BaseCommand
class InvalidCommand(BaseCommand):
help = ("Test raising an error if both requires_system_checks "
"and requires_model_validation are defined.")
requires_system_checks = True
requires_model_validation = True
def handle(self, **options):
... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,253 | MulticsYin/MulticsSH | refs/heads/master | /home/views.py | #_*_ coding:utf-8 _*_
# 为保证代码的简洁,添加模版文件。视图只用使用模型对应的模板文件,传入元组自动匹配
# 模板变量便可。模板文件在 ./templates/home
from django.shortcuts import render
from django.http import HttpResponse
from .models import *
from django.shortcuts import redirect
# Create your views here.
#主目录,本项目不涉及前端,故只保留一个接口而不进行开发。
def index(request):
return ... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,254 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/admin_views/urls.py | from django.conf.urls import include, url
from . import admin, custom_has_permission_admin, customadmin, views
urlpatterns = [
url(r'^test_admin/admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^test_admin/admin/secure-view/$', views.secure_view, name='secure_view'),
url(r'^test_admin/admin/'... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,255 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/urlpatterns_reverse/erroneous_urls.py | import warnings
from django.conf.urls import url
from django.utils.deprecation import RemovedInDjango110Warning
from . import views
# Test deprecated behavior of passing strings as view to url().
# Some of these can be removed in Django 1.10 as they aren't convertable to
# callables.
with warnings.catch_warnings():
... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,256 | MulticsYin/MulticsSH | refs/heads/master | /need_install/django-admin-bootstrap/bootstrap_admin/templatetags/bootstrap_admin_template_tags.py | from django.contrib.admin import site
from django.apps import apps
from django.utils.text import capfirst
from django.core.urlresolvers import reverse, NoReverseMatch
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.conf import settings
from django import template
from dj... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,257 | MulticsYin/MulticsSH | refs/heads/master | /home/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import DjangoUeditor.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='tb_datapoint_list',
fields=[
... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,258 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/template_tests/syntax_tests/test_ssi.py | from __future__ import unicode_literals
import os
from django.template import Context, Engine
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import (
RemovedInDjango19Warning, RemovedInDjango110Warning,
)
from ..utils import ROOT, setup
@ignore_warnings(category=RemovedIn... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
45,259 | MulticsYin/MulticsSH | refs/heads/master | /need_install/Django-1.8.17/tests/utils_tests/test_tzinfo.py | import copy
import datetime
import os
import pickle
import time
import unittest
import warnings
from django.test import ignore_warnings
from django.utils.deprecation import RemovedInDjango19Warning
# Swallow the import-time warning to test the deprecated implementation.
with warnings.catch_warnings():
warnings.fi... | {"/home/admin.py": ["/home/models.py"], "/need_install/Django-1.8.17/tests/fixtures_migration/tests.py": ["/need_install/Django-1.8.17/tests/fixtures_migration/models.py"], "/home/views.py": ["/home/models.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.