repo_name stringclasses 400
values | branch_name stringclasses 4
values | file_content stringlengths 16 72.5k | language stringclasses 1
value | num_lines int64 1 1.66k | avg_line_length float64 6 85 | max_line_length int64 9 949 | path stringlengths 5 103 | alphanum_fraction float64 0.29 0.89 | alpha_fraction float64 0.27 0.89 | context stringlengths 0 91.6k | context_file_paths listlengths 0 3 |
|---|---|---|---|---|---|---|---|---|---|---|---|
shuishen112/pairwise-rnn | refs/heads/master |
import data_helper
import time
import datetime
import os
import tensorflow as tf
import numpy as np
import evaluation
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)
timeDay = time.strftime("%Y%m%d", timeArray)
print (timeStamp)
def main(args):
ar... | Python | 116 | 36.043102 | 159 | /main.py | 0.553088 | 0.546842 | from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime,os
import models
import numpy as np
import evaluation
import sys
import logging
import time
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)... | [
"/run.py",
"/models/QA_CNN_pairwise.py",
"/data_helper.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | class Singleton(object):
__instance=None
def __init__(self):
pass
def getInstance(self):
if Singleton.__instance is None:
# Singleton.__instance=object.__new__(cls,*args,**kwd)
Singleton.__instance=self.get_test_flag()
print("build FLAGS over")
ret... | Python | 197 | 60.426395 | 121 | /config.py | 0.627396 | 0.597571 | # -*- coding: utf-8 -*-
from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime
import os
import models
import numpy as np
import evaluation
from data_helper import log_time_delta,getLogger
logger=getLogger()
args = Singleton().get_rnn_flag()
#args... | [
"/test.py",
"/data_helper.py",
"/run.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime,os
import models
import numpy as np
import evaluation
import sys
import logging
import time
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)... | Python | 164 | 35.829269 | 161 | /run.py | 0.628704 | 0.62142 | class Singleton(object):
__instance=None
def __init__(self):
pass
def getInstance(self):
if Singleton.__instance is None:
# Singleton.__instance=object.__new__(cls,*args,**kwd)
Singleton.__instance=self.get_test_flag()
print("build FLAGS over")
ret... | [
"/config.py",
"/data_helper.py",
"/models/my/nn.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | #coding:utf-8
import tensorflow as tf
import numpy as np
from tensorflow.contrib import rnn
import models.blocks as blocks
# model_type :apn or qacnn
class QA_CNN_extend(object):
# def __init__(self,max_input_left,max_input_right,batch_size,vocab_size,embedding_size,filter_sizes,num_filters,hidden_size,
# dro... | Python | 381 | 46.682415 | 147 | /models/QA_CNN_pairwise.py | 0.592162 | 0.5751 | #-*- coding:utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import string
from collections import Counter
import pandas as pd
from tqdm import tqdm
import random
from functools import wraps
import time
import pickle
def log_time_delta(func):
@wraps(func)
def _deco(*args, **kwargs):
star... | [
"/data_helper.py",
"/main.py",
"/models/__init__.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | from my.general import flatten, reconstruct, add_wd, exp_mask
import numpy as np
import tensorflow as tf
_BIAS_VARIABLE_NAME = "bias"
_WEIGHTS_VARIABLE_NAME = "kernel"
def linear(args, output_size, bias, bias_start=0.0, scope=None, squeeze=False, wd=0.0, input_keep_prob=1.0,
is_train=None):#, name_w='',... | Python | 160 | 36.712502 | 116 | /models/my/nn.py | 0.572754 | 0.558005 | #-*- coding:utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import string
from collections import Counter
import pandas as pd
from tqdm import tqdm
import random
from functools import wraps
import time
import pickle
def log_time_delta(func):
@wraps(func)
def _deco(*args, **kwargs):
star... | [
"/data_helper.py",
"/models/QA_CNN_pairwise.py",
"/test.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | from .QA_CNN_pairwise import QA_CNN_extend as CNN
from .QA_RNN_pairwise import QA_RNN_extend as RNN
from .QA_CNN_quantum_pairwise import QA_CNN_extend as QCNN
def setup(opt):
if opt["model_name"]=="cnn":
model=CNN(opt)
elif opt["model_name"]=="rnn":
model=RNN(opt)
elif opt['model_name']=='qcnn':
model=QCNN(opt... | Python | 14 | 25.642857 | 58 | /models/__init__.py | 0.691689 | 0.689008 |
import data_helper
import time
import datetime
import os
import tensorflow as tf
import numpy as np
import evaluation
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)
timeDay = time.strftime("%Y%m%d", timeArray)
print (timeStamp)
def main(args):
ar... | [
"/main.py",
"/run.py",
"/models/my/nn.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | # -*- coding: utf-8 -*-
from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime
import os
import models
import numpy as np
import evaluation
from data_helper import log_time_delta,getLogger
logger=getLogger()
args = Singleton().get_rnn_flag()
#args... | Python | 114 | 31.622807 | 92 | /test.py | 0.651019 | 0.64324 | #coding:utf-8
import tensorflow as tf
import numpy as np
from tensorflow.contrib import rnn
import models.blocks as blocks
# model_type :apn or qacnn
class QA_CNN_extend(object):
# def __init__(self,max_input_left,max_input_right,batch_size,vocab_size,embedding_size,filter_sizes,num_filters,hidden_size,
# dro... | [
"/models/QA_CNN_pairwise.py",
"/main.py",
"/config.py"
] |
shuishen112/pairwise-rnn | refs/heads/master | #-*- coding:utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import string
from collections import Counter
import pandas as pd
from tqdm import tqdm
import random
from functools import wraps
import time
import pickle
def log_time_delta(func):
@wraps(func)
def _deco(*args, **kwargs):
star... | Python | 363 | 33.487602 | 167 | /data_helper.py | 0.582389 | 0.574804 | from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime,os
import models
import numpy as np
import evaluation
import sys
import logging
import time
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)... | [
"/run.py",
"/models/QA_CNN_pairwise.py",
"/test.py"
] |
pablor0mero/Placester_Test_Pablo_Romero | refs/heads/master | # For this solution I'm using TextBlob, using it's integration with WordNet.
from textblob import TextBlob
from textblob import Word
from textblob.wordnet import VERB
import nltk
import os
import sys
import re
import json
results = { "results" : [] }
#Override NLTK data path to use the one I uploaded in the folder
d... | Python | 71 | 44.929577 | 157 | /main.py | 0.670813 | 0.666869 | [] | |
GabinCleaver/Auto_Discord_Bump | refs/heads/main | import requests
import time
token = "TOKEN"
headers = {
'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7',
'Authorization' : token
}
id = input(f"[?] Salon ID: ")
print("")
while True:
requests.post(
f"https://discord.com/api/... | Python | 21 | 20.809525 | 109 | /autobump.py | 0.561845 | 0.51153 | [] | |
altopalido/yelp_python | refs/heads/master | # Madis Settings
MADIS_PATH='/Users/alexiatopalidou/Desktop/erg/madis/src'
# Webserver Settings
# IMPORTANT: The port must be available.
web_port = 9090 # must be integer (this is wrong:'9090')
| Python | 6 | 31.666666 | 57 | /yelp_python/settings.py | 0.75 | 0.709184 | # ----- CONFIGURE YOUR EDITOR TO USE 4 SPACES PER TAB ----- #
import settings
import sys
def connection():
''' User this function to create your connections '''
import sys
sys.path.append(settings.MADIS_PATH)
import madis
con = madis.functions.Connection('/Users/alexiatopalidou/Desktop/erg/yelp_p... | [
"/yelp_python/app.py"
] |
altopalido/yelp_python | refs/heads/master | # ----- CONFIGURE YOUR EDITOR TO USE 4 SPACES PER TAB ----- #
import settings
import sys
def connection():
''' User this function to create your connections '''
import sys
sys.path.append(settings.MADIS_PATH)
import madis
con = madis.functions.Connection('/Users/alexiatopalidou/Desktop/erg/yelp_p... | Python | 206 | 26.485437 | 361 | /yelp_python/app.py | 0.622395 | 0.612681 | # Madis Settings
MADIS_PATH='/Users/alexiatopalidou/Desktop/erg/madis/src'
# Webserver Settings
# IMPORTANT: The port must be available.
web_port = 9090 # must be integer (this is wrong:'9090')
| [
"/yelp_python/settings.py"
] |
smellycats/SX-CarRecgServer | refs/heads/master | from car_recg import app
from car_recg.recg_ser import RecgServer
from ini_conf import MyIni
if __name__ == '__main__':
rs = RecgServer()
rs.main()
my_ini = MyIni()
sys_ini = my_ini.get_sys_conf()
app.config['THREADS'] = sys_ini['threads']
app.config['MAXSIZE'] = sys_ini['threads'] * 16
app... | Python | 14 | 27.857143 | 64 | /run.py | 0.613861 | 0.59901 | # -*- coding: utf-8 -*-
import Queue
class Config(object):
# 密码 string
SECRET_KEY = 'hellokitty'
# 服务器名称 string
HEADER_SERVER = 'SX-CarRecgServer'
# 加密次数 int
ROUNDS = 123456
# token生存周期,默认1小时 int
EXPIRES = 7200
# 数据库连接 string
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@127.0.0... | [
"/car_recg/config.py",
"/car_recg/views.py"
] |
smellycats/SX-CarRecgServer | refs/heads/master | # -*- coding: utf-8 -*-
import Queue
class Config(object):
# 密码 string
SECRET_KEY = 'hellokitty'
# 服务器名称 string
HEADER_SERVER = 'SX-CarRecgServer'
# 加密次数 int
ROUNDS = 123456
# token生存周期,默认1小时 int
EXPIRES = 7200
# 数据库连接 string
SQLALCHEMY_DATABASE_URI = 'mysql://root:root@127.0.0... | Python | 53 | 17.905661 | 69 | /car_recg/config.py | 0.593812 | 0.56986 | # -*- coding: utf-8 -*-
import os
import Queue
import random
from functools import wraps
import arrow
from flask import g, request
from flask_restful import reqparse, Resource
from passlib.hash import sha256_crypt
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from car_recg import app, db, api... | [
"/car_recg/views.py",
"/run.py"
] |
smellycats/SX-CarRecgServer | refs/heads/master | # -*- coding: utf-8 -*-
import os
import Queue
import random
from functools import wraps
import arrow
from flask import g, request
from flask_restful import reqparse, Resource
from passlib.hash import sha256_crypt
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from car_recg import app, db, api... | Python | 176 | 30.78409 | 134 | /car_recg/views.py | 0.558634 | 0.540222 | from car_recg import app
from car_recg.recg_ser import RecgServer
from ini_conf import MyIni
if __name__ == '__main__':
rs = RecgServer()
rs.main()
my_ini = MyIni()
sys_ini = my_ini.get_sys_conf()
app.config['THREADS'] = sys_ini['threads']
app.config['MAXSIZE'] = sys_ini['threads'] * 16
app... | [
"/run.py",
"/car_recg/config.py"
] |
josemiche11/reversebycondition | refs/heads/master | '''
Input- zoho123
Output- ohoz123
'''
char= input("Enter the string: ")
char2= list(char)
num= "1234567890"
list1= [0]*len(char)
list2=[]
for i in range(len(char)):
if char2[i] not in num:
list2.append( char2.index( char2[i]))
char2[i]= "*"
list2.reverse()
k=0
for j in range( len(c... | Python | 26 | 17.461538 | 45 | /reversebycondition.py | 0.539526 | 0.472332 | [] | |
Lasyin/batch-resize | refs/heads/master | import os
import sys
import argparse
from PIL import Image # From Pillow (pip install Pillow)
def resize_photos(dir, new_x, new_y, scale):
if(not os.path.exists(dir)):
# if not in full path format (/usrers/user/....)
# check if path is in local format (folder is in current working directory)
... | Python | 73 | 43.109589 | 179 | /batch_resize.py | 0.554969 | 0.551863 | [] | |
snehG0205/Twitter_Mining | refs/heads/master | import tweepy
import csv
import pandas as pd
from textblob import TextBlob
import matplotlib.pyplot as plt
####input your credentials here
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9'
access_token = '975924102190874624-uk5zGlYRwItkj7pZO2m89NefRm5DFLg... | Python | 104 | 28.73077 | 157 | /tweepy_tester.py | 0.66796 | 0.655674 | import matplotlib.pyplot as plt
# Data to plot
labels = 'Neutral', 'Positive', 'Negative'
sizes = [20, 40, 40]
colors = ['lightskyblue','yellowgreen', 'lightcoral']
explode = (0.0, 0, 0) # explode 1st slice
# Plot
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True,... | [
"/piPlotter.py",
"/Twitter-Flask/hello.py",
"/tester.py"
] |
snehG0205/Twitter_Mining | refs/heads/master | import tweepy
import csv
import pandas as pd
# keys and tokens from the Twitter Dev Console
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9'
access_token = '975924102190874624-uk5zGlYRwItkj7pZO2m89NefRm5DFLg'
access_token_secret = 'ChvmTjG8hl61xUrXkk3Ad... | Python | 52 | 32.53846 | 146 | /twitter1.py | 0.729513 | 0.716332 | #!/usr/bin/env python
print ("some output")
return "hello"
--- FILE SEPARATOR ---
import csv
csvFile = open('res.csv', 'w+')
--- FILE SEPARATOR ---
from flask import Flask, render_template, request
from test import mining
app = Flask(__name__)
@app.route('/')
def index():
return render_template('hello.html')
@... | [
"/Twitter-Flask/hello.py",
"/tester.py",
"/Twitter-Flask/app.py"
] |
snehG0205/Twitter_Mining | refs/heads/master | import csv
csvFile = open('res.csv', 'w+') | Python | 2 | 20.5 | 31 | /tester.py | 0.642857 | 0.642857 | import tweepy
import csv
import pandas as pd
# keys and tokens from the Twitter Dev Console
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9'
access_token = '975924102190874624-uk5zGlYRwItkj7pZO2m89NefRm5DFLg'
access_token_secret = 'ChvmTjG8hl61xUrXkk3Ad... | [
"/twitter1.py",
"/Twitter-Flask/hello.py",
"/Twitter-Flask/app.py"
] |
snehG0205/Twitter_Mining | refs/heads/master | from test import mining
tag = "#WednesdayWisdom"
limit = "10"
sen_list = mining(tag,int(limit))
print(sen_list) | Python | 5 | 21.4 | 33 | /Twitter-Flask/untitled.py | 0.72973 | 0.711712 | import matplotlib.pyplot as plt
# Data to plot
labels = 'Neutral', 'Positive', 'Negative'
sizes = [20, 40, 40]
colors = ['lightskyblue','yellowgreen', 'lightcoral']
explode = (0.0, 0, 0) # explode 1st slice
# Plot
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True,... | [
"/piPlotter.py",
"/tweepy_tester.py",
"/tester.py"
] |
snehG0205/Twitter_Mining | refs/heads/master | from flask import Flask, render_template, request
from test import mining
app = Flask(__name__)
@app.route('/')
def index():
return render_template('hello.html')
@app.route('/', methods=['GET', 'POST'])
def submit():
if request.method == 'POST':
print (request.form) # debug line, see data printed below
tag = r... | Python | 24 | 25.416666 | 124 | /Twitter-Flask/app.py | 0.631912 | 0.627172 | import tweepy
import csv
import pandas as pd
from textblob import TextBlob
import matplotlib.pyplot as plt
####input your credentials here
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9'
access_token = '975924102190874624-uk5zGlYRwItkj7pZO2m89NefRm5DFLg... | [
"/tweepy_tester.py",
"/Twitter-Flask/hello.py",
"/piPlotter.py"
] |
snehG0205/Twitter_Mining | refs/heads/master | #!/usr/bin/env python
print ("some output")
return "hello" | Python | 4 | 14 | 21 | /Twitter-Flask/hello.py | 0.694915 | 0.694915 | import csv
csvFile = open('res.csv', 'w+')
--- FILE SEPARATOR ---
import tweepy
import csv
import pandas as pd
from textblob import TextBlob
import matplotlib.pyplot as plt
####input your credentials here
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9... | [
"/tester.py",
"/tweepy_tester.py",
"/Twitter-Flask/app.py"
] |
snehG0205/Twitter_Mining | refs/heads/master | import matplotlib.pyplot as plt
# Data to plot
labels = 'Neutral', 'Positive', 'Negative'
sizes = [20, 40, 40]
colors = ['lightskyblue','yellowgreen', 'lightcoral']
explode = (0.0, 0, 0) # explode 1st slice
# Plot
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True,... | Python | 16 | 27.125 | 61 | /piPlotter.py | 0.685969 | 0.650334 | import csv
csvFile = open('res.csv', 'w+')
--- FILE SEPARATOR ---
import tweepy
import csv
import pandas as pd
from textblob import TextBlob
import matplotlib.pyplot as plt
####input your credentials here
consumer_key = 'FgCG8zcxF4oINeuAqUYzOw9xh'
consumer_secret = 'SrSu7WhrYUpMZnHw7a5ui92rUA1n2jXNoZVb3nJ5wEsXC5xlN9... | [
"/tester.py",
"/tweepy_tester.py",
"/Twitter-Flask/hello.py"
] |
nopple/ctf | refs/heads/master | #!/usr/bin/env python
import socket, subprocess, sys
from struct import pack, unpack
global scenes
global officers
scenes = {}
officers = {}
remote = len(sys.argv) > 1
PORT = 8888
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if remote:
HOST = "dosfun4u_5d712652e1d06a362f7fc6d12d66755b.2014.shallweplayaga... | Python | 124 | 25.620968 | 131 | /dosfun4u/pwn.py | 0.668585 | 0.624962 | #!/usr/bin/env python
import socket
from struct import pack, unpack
DEBUG = False
server = "shitsco_c8b1aa31679e945ee64bde1bdb19d035.2014.shallweplayaga.me"
server = "127.0.0.1"
port = 31337
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((server, port))
s.settimeout(30)
def recv_until(s, pattern):
... | [
"/shitsco/pwn.py"
] |
nopple/ctf | refs/heads/master | #!/usr/bin/env python
import socket
from struct import pack, unpack
DEBUG = False
server = "shitsco_c8b1aa31679e945ee64bde1bdb19d035.2014.shallweplayaga.me"
server = "127.0.0.1"
port = 31337
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((server, port))
s.settimeout(30)
def recv_until(s, pattern):
... | Python | 71 | 25.830986 | 127 | /shitsco/pwn.py | 0.669816 | 0.618898 | #!/usr/bin/env python
import socket, subprocess, sys
from struct import pack, unpack
global scenes
global officers
scenes = {}
officers = {}
remote = len(sys.argv) > 1
PORT = 8888
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if remote:
HOST = "dosfun4u_5d712652e1d06a362f7fc6d12d66755b.2014.shallweplayaga... | [
"/dosfun4u/pwn.py"
] |
phu-bui/Nhan_dien_bien_bao_giao_thong | refs/heads/master | import tkinter as tk
from tkinter import filedialog
from tkinter import *
from PIL import Image, ImageTk
import numpy
from keras.models import load_model
model = load_model('BienBao.h5')
class_name = {
1:'Speed limit (20km/h)',
2:'Speed limit (30km/h)',
3:'Speed limit (50km/h)',
4:'Speed limit (60km/h)'... | Python | 103 | 30.747572 | 107 | /main.py | 0.631386 | 0.579688 | [] | |
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | def returnSum(dict):
sum=0
for i in dict:
sum=sum+dict[i]
return sum
dict={'Rick':85,'Amit':42,'George':53,'Tanya':60,'Linda':35}
print 'sum:', returnSum(dict)
| Python | 7 | 24.714285 | 60 | /Dictionary with function.py | 0.582888 | 0.524064 | n=int(input("enter the numbers u want to print:"))
for i in range(1,n+1):
if(i%3==0):
print ('Fizz')
continue
elif(i%5==0):
print ('Buzz')
continue
print i
--- FILE SEPARATOR ---
def switch(on_strike):
players = {1,2}
return list(players.diffe... | [
"/FizzBuzz.py",
"/Cricket Match Player Score.py",
"/repeat.py"
] |
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | n=int(input("enter the numbers u want to print:"))
for i in range(1,n+1):
if(i%3==0):
print ('Fizz')
continue
elif(i%5==0):
print ('Buzz')
continue
print i
| Python | 9 | 21.222221 | 50 | /FizzBuzz.py | 0.46789 | 0.440367 | arr=[1,2,3,5,8,4,7,9,1,4,12,5,6,5,2,1,0,8,1]
a = [None] * len(arr);
visited = 0;
for i in range(0, len(arr)):
count = 1;
for j in range(i+1, len(arr)):
if(arr[i] == arr[j]):
count = count + 1;
a[j] = visited;
if(a[i] != visited):
a[i]... | [
"/repeat.py",
"/Cricket Match Player Score.py",
"/Dictionary with function.py"
] |
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | def switch(on_strike):
players = {1,2}
return list(players.difference(set([on_strike])))[0]
def get_player(previous_score, previous_player, previous_bowl_number):
if previous_score%2 == 0 and (previous_bowl_number%6 !=0 or previous_bowl_number ==0):
player = previous_player
elif p... | Python | 36 | 28.611111 | 90 | /Cricket Match Player Score.py | 0.646098 | 0.61343 | n=int(input("enter the numbers u want to print:"))
for i in range(1,n+1):
if(i%3==0):
print ('Fizz')
continue
elif(i%5==0):
print ('Buzz')
continue
print i
--- FILE SEPARATOR ---
arr=[1,2,3,5,8,4,7,9,1,4,12,5,6,5,2,1,0,8,1]
a = [None] * len(arr);
vi... | [
"/FizzBuzz.py",
"/repeat.py",
"/Dictionary with function.py"
] |
Jerin-Alisha/Python-Code-Assessment | refs/heads/master | arr=[1,2,3,5,8,4,7,9,1,4,12,5,6,5,2,1,0,8,1]
a = [None] * len(arr);
visited = 0;
for i in range(0, len(arr)):
count = 1;
for j in range(i+1, len(arr)):
if(arr[i] == arr[j]):
count = count + 1;
a[j] = visited;
if(a[i] != visited):
a[i]... | Python | 14 | 31.285715 | 69 | /repeat.py | 0.408511 | 0.353191 | n=int(input("enter the numbers u want to print:"))
for i in range(1,n+1):
if(i%3==0):
print ('Fizz')
continue
elif(i%5==0):
print ('Buzz')
continue
print i
--- FILE SEPARATOR ---
def switch(on_strike):
players = {1,2}
return list(players.diffe... | [
"/FizzBuzz.py",
"/Cricket Match Player Score.py",
"/Dictionary with function.py"
] |
TheDinner22/lightning-sim | refs/heads/main | # represent the "board" in code
# dependencies
import random
class Board:
def __init__(self, width=10):
self.width = width
self.height = width * 2
self.WALL_CHANCE = .25
self.FLOOR_CHANCE = .15
# create the grid
self.create_random_grid()
def create_random_gri... | Python | 191 | 35.329842 | 97 | /lib/board.py | 0.51333 | 0.506269 | # this could and will be better i just needed to make it here as a
# proof of concept but it will be online and better later
import os, sys
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # adds project dir to places it looks for the modules
sys.path.append(BASE_PATH)
from lib.board import B... | [
"/main.py",
"/lib/window.py"
] |
TheDinner22/lightning-sim | refs/heads/main | # use pygame to show the board on a window
# dependencies
import pygame, random
class Window:
def __init__(self, board):
# init py game
pygame.init()
# width height
self.WIDTH = 600
self.HEIGHT = 600
# diffenet display modes
self.display_one = False
... | Python | 159 | 28.754717 | 87 | /lib/window.py | 0.501057 | 0.487104 | # this could and will be better i just needed to make it here as a
# proof of concept but it will be online and better later
import os, sys
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # adds project dir to places it looks for the modules
sys.path.append(BASE_PATH)
from lib.board import B... | [
"/main.py",
"/lib/board.py"
] |
TheDinner22/lightning-sim | refs/heads/main | # this could and will be better i just needed to make it here as a
# proof of concept but it will be online and better later
import os, sys
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # adds project dir to places it looks for the modules
sys.path.append(BASE_PATH)
from lib.board import B... | Python | 15 | 25.4 | 125 | /main.py | 0.736709 | 0.736709 | # represent the "board" in code
# dependencies
import random
class Board:
def __init__(self, width=10):
self.width = width
self.height = width * 2
self.WALL_CHANCE = .25
self.FLOOR_CHANCE = .15
# create the grid
self.create_random_grid()
def create_random_gri... | [
"/lib/board.py",
"/lib/window.py"
] |
JoeChan/openbgp | refs/heads/master | # Copyright 2015 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | Python | 267 | 24.932585 | 80 | /openbgp/common/constants.py | 0.69103 | 0.617362 | [] | |
Glitchfix/TransposeMatrixIndorse | refs/heads/master | from flask import Flask, render_template, request, jsonify
from flask_cors import CORS
import json
import numpy as np
app = Flask(__name__)
CORS(app)
@app.route('/transpose', methods=["POST"])
def homepage():
data = request.json
result = None
error = ""
try:
mat = data["matrix"]
mat =... | Python | 29 | 19.724138 | 58 | /server.py | 0.579035 | 0.579035 | [] | |
shlsheth263/malware-detection-using-ANN | refs/heads/master | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import test_python3
class Root(Tk):
def __init__(self):
super(Root, self).__init__()
self.title("Malware Detection")
self.minsize(500, 300)
self.labelFrame = ttk.LabelFrame(self, text = " Open File")
... | Python | 35 | 24.685715 | 99 | /python/gui.py | 0.620267 | 0.600223 | #!/usr/bin/env python
import sys
import time
import pandas as pd
import pepy
import binascii
import numpy as np
from hashlib import md5
import sklearn
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tensorflow.keras.models import load_model
def test(p):
exe = {}
print("Signature... | [
"/python/test_python3_cli.py~"
] |
shlsheth263/malware-detection-using-ANN | refs/heads/master | #!/usr/bin/env python
import sys
import time
import pandas as pd
import pepy
import binascii
import numpy as np
from hashlib import md5
import sklearn
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tensorflow.keras.models import load_model
def test(p):
exe = {}
print("Signature... | Python | 386 | 35.992229 | 107 | /python/test_python3_cli.py~ | 0.655182 | 0.439846 | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import test_python3
class Root(Tk):
def __init__(self):
super(Root, self).__init__()
self.title("Malware Detection")
self.minsize(500, 300)
self.labelFrame = ttk.LabelFrame(self, text = " Open File")
... | [
"/python/gui.py"
] |
Sssssbo/SDCNet | refs/heads/master | import numpy as np
import os
import torch
import torch.nn.functional as F
from PIL import Image
from torch.autograd import Variable
from torchvision import transforms
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
from misc import check_mkdir, AvgMete... | Python | 226 | 45.637169 | 227 | /infer_SDCNet.py | 0.54592 | 0.509962 | import os
import os.path
import torch.utils.data as data
from PIL import Image
class ImageFolder_joint(data.Dataset):
# image and gt should be in the same folder and have same filename except extended name (jpg and png respectively)
def __init__(self, label_list, joint_transform=None, transform=None, target_... | [
"/datasets.py",
"/count_dataset.py",
"/model/make_model.py"
] |
Sssssbo/SDCNet | refs/heads/master | from .resnext101 import ResNeXt101
| Python | 1 | 34 | 34 | /resnext/__init__.py | 0.857143 | 0.685714 | import torch
import torch.nn as nn
from .backbones.resnet import ResNet, Comb_ResNet, Pure_ResNet, Jointin_ResNet, Jointout_ResNet, BasicBlock, Bottleneck, GDN_Bottleneck, IN_Bottleneck, IN2_Bottleneck, SNR_Bottleneck, SNR2_Bottleneck, SNR3_Bottleneck
from loss.arcface import ArcFace
from .backbones.resnet_ibn_a import... | [
"/model/make_model.py",
"/model.py",
"/resnet/make_model.py"
] |
Sssssbo/SDCNet | refs/heads/master | import numpy as np
import os
import pylab as pl
#import pydensecrf.densecrf as dcrf
class AvgMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
... | Python | 227 | 25.356829 | 110 | /misc.py | 0.56343 | 0.531673 | import math
import torch
from torch import nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class BasicBlock(nn.Module):
expansion = 1
def __init__(s... | [
"/model/backbones/resnet.py",
"/count_dataset.py",
"/resnet/__init__.py"
] |
Sssssbo/SDCNet | refs/heads/master | from .make_model import ResNet50, ResNet50_BIN, ResNet50_LowIN | Python | 1 | 62 | 62 | /resnet/__init__.py | 0.822581 | 0.725806 | resnet50_path = './resnet/resnet50-19c8e357.pth'
--- FILE SEPARATOR ---
from .resnet import ResNet, BasicBlock, Bottleneck
import torch
from torch import nn
from .config import resnet50_path
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download... | [
"/resnet/config.py",
"/resnet/make_model.py",
"/resnext/__init__.py"
] |
Sssssbo/SDCNet | refs/heads/master | from .resnet import ResNet, BasicBlock, Bottleneck
import torch
from torch import nn
from .config import resnet50_path
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'resnet50': 'https://downlo... | Python | 104 | 32.740383 | 78 | /resnet/make_model.py | 0.586492 | 0.54175 | resnet50_path = './resnet/resnet50-19c8e357.pth'
--- FILE SEPARATOR ---
from .make_model import ResNet50, ResNet50_BIN, ResNet50_LowIN
--- FILE SEPARATOR ---
import math
import torch
from torch import nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in... | [
"/resnet/config.py",
"/resnet/__init__.py",
"/model/backbones/resnet.py"
] |
Sssssbo/SDCNet | refs/heads/master | import os
import os.path
import torch.utils.data as data
from PIL import Image
class ImageFolder_joint(data.Dataset):
# image and gt should be in the same folder and have same filename except extended name (jpg and png respectively)
def __init__(self, label_list, joint_transform=None, transform=None, target_... | Python | 125 | 39.872002 | 118 | /datasets.py | 0.623214 | 0.622627 | from .resnext101 import ResNeXt101
--- FILE SEPARATOR ---
from .resnet import ResNet, BasicBlock, Bottleneck
import torch
from torch import nn
from .config import resnet50_path
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/m... | [
"/resnext/__init__.py",
"/resnet/make_model.py",
"/count_dataset.py"
] |
Sssssbo/SDCNet | refs/heads/master | import torch
import torch.nn as nn
from .backbones.resnet import ResNet, Comb_ResNet, Pure_ResNet, Jointin_ResNet, Jointout_ResNet, BasicBlock, Bottleneck, GDN_Bottleneck, IN_Bottleneck, IN2_Bottleneck, SNR_Bottleneck, SNR2_Bottleneck, SNR3_Bottleneck
from loss.arcface import ArcFace
from .backbones.resnet_ibn_a import... | Python | 399 | 48.255638 | 216 | /model/make_model.py | 0.573042 | 0.515189 | import numpy as np
import os
import torch
from PIL import Image
from torch.autograd import Variable
from torchvision import transforms
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
import cv2
import numpy as np
from config import ecssd_path, hkuis_pa... | [
"/create_free.py",
"/resnext/__init__.py",
"/count_dataset.py"
] |
Sssssbo/SDCNet | refs/heads/master | resnet50_path = './resnet/resnet50-19c8e357.pth'
| Python | 1 | 48 | 48 | /resnet/config.py | 0.755102 | 0.55102 | import torch
import torch.nn as nn
from .backbones.resnet import ResNet, Comb_ResNet, Pure_ResNet, Jointin_ResNet, Jointout_ResNet, BasicBlock, Bottleneck, GDN_Bottleneck, IN_Bottleneck, IN2_Bottleneck, SNR_Bottleneck, SNR2_Bottleneck, SNR3_Bottleneck
from loss.arcface import ArcFace
from .backbones.resnet_ibn_a import... | [
"/model/make_model.py",
"/misc.py",
"/infer_SDCNet.py"
] |
Sssssbo/SDCNet | refs/heads/master | import torch
import torch.nn.functional as F
from torch import nn
from resnext import ResNeXt101
class R3Net(nn.Module):
def __init__(self):
super(R3Net, self).__init__()
res50 = ResNeXt101()
self.layer0 = res50.layer0
self.layer1 = res50.layer1
self.layer2 = res50.layer2
... | Python | 529 | 52.631378 | 149 | /model.py | 0.556625 | 0.46396 | import numpy as np
import os
import pylab as pl
#import pydensecrf.densecrf as dcrf
class AvgMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
... | [
"/misc.py",
"/resnet/make_model.py",
"/model/make_model.py"
] |
Sssssbo/SDCNet | refs/heads/master | import numpy as np
import os
import torch
from PIL import Image
from torch.autograd import Variable
from torchvision import transforms
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
import cv2
import numpy as np
from config import ecssd_path, hkuis_pa... | Python | 41 | 24.024391 | 100 | /create_free.py | 0.719298 | 0.691033 | import math
import torch
from torch import nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class BasicBlock(nn.Module):
expansion = 1
def __init__(s... | [
"/model/backbones/resnet.py",
"/SDCNet.py",
"/infer_SDCNet.py"
] |
Sssssbo/SDCNet | refs/heads/master | import numpy as np
import os
import torch
from PIL import Image
from torch.autograd import Variable
from torchvision import transforms
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
path_list = ['msra10k', 'ECSSD', 'DUT-OMROM', 'DUTS-TR', 'DUTS-TE', '... | Python | 75 | 36.813332 | 284 | /count_dataset.py | 0.492595 | 0.435825 | from .make_model import ResNet50, ResNet50_BIN, ResNet50_LowIN
--- FILE SEPARATOR ---
import torch
import torch.nn.functional as F
from torch import nn
from resnext import ResNeXt101
class R3Net(nn.Module):
def __init__(self):
super(R3Net, self).__init__()
res50 = ResNeXt101()
self.laye... | [
"/resnet/__init__.py",
"/model.py",
"/infer_SDCNet.py"
] |
Sssssbo/SDCNet | refs/heads/master | import datetime
import os
import time
import torch
from torch import nn
from torch import optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision import transforms
import pandas as pd
import numpy as np
import joint_transforms
from config import msra10k_path, MTDD_train_path... | Python | 184 | 35.255436 | 172 | /SDCNet.py | 0.558087 | 0.529006 | import numpy as np
import os
import pylab as pl
#import pydensecrf.densecrf as dcrf
class AvgMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
... | [
"/misc.py",
"/model/backbones/resnet.py",
"/resnet/make_model.py"
] |
Sssssbo/SDCNet | refs/heads/master | import math
import torch
from torch import nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class BasicBlock(nn.Module):
expansion = 1
def __init__(s... | Python | 1,100 | 34.375454 | 153 | /model/backbones/resnet.py | 0.533126 | 0.481754 | import numpy as np
import os
import pylab as pl
#import pydensecrf.densecrf as dcrf
class AvgMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
... | [
"/misc.py",
"/resnet/make_model.py",
"/resnet/__init__.py"
] |
ariksu/pyhfss_parser | refs/heads/master | from setuptools import setup
setup(
name='pyhfss_parser',
version='0.0.0',
packages=['', 'venv.Lib.site-packages.py', 'venv.Lib.site-packages.py._io', 'venv.Lib.site-packages.py._log',
'venv.Lib.site-packages.py._code', 'venv.Lib.site-packages.py._path',
'venv.Lib.site-packages.... | Python | 77 | 79.987015 | 125 | /setup.py | 0.639994 | 0.609205 | [] | |
kswgit/ctfs | refs/heads/master | from pwn import *
import time
context.update(arch='x86', bits=64)
iteration = 0x1000
cache_cycle = 0x10000000
shellcode = asm('''
_start:
mov rdi, 0x200000000
mov rsi, 0x300000000
mov rbp, 0
loop_start:
rdtsc
shl rdx, 32
or rax, rdx
push rax
mov rax, rdi
mov rdx, %d
a:
mov rcx, 0x1000
a2:
prefetcht1 [rax+rcx]
loop a... | Python | 56 | 12.803572 | 39 | /0ctf2017/pages.py | 0.68863 | 0.577519 | [] | |
esdb/plinear | refs/heads/master | assembly = '''
7328- 400560: c5 f9 6e c7 vmovd %edi,%xmm0
7378- 400564: c4 e2 7d 58 c0 vpbroadcastd %xmm0,%ymm0
7435- 400569: c5 fd 76 0e vpcmpeqd (%rsi),%ymm0,%ymm1
7495- 40056d: c5 fd 76 56 20 vpcmpeqd 0x20(%rsi),%ymm0,%ymm2
7559- 400572: c5 fd 76 5e 40 vp... | Python | 44 | 43.386364 | 119 | /c/translate.py | 0.524322 | 0.376856 | [] | |
riadghorra/whiteboard-oop-project | refs/heads/master | """
Module contenant toutes les figures et opérations de base
"""
import pygame
import pygame.draw
from datetime import datetime
def distance(v1, v2):
"""
Calcule la distance euclidienne entre deux vecteurs
"""
try:
return ((v1[0] - v2[0]) ** 2 + (v1[1] - v2[1]) ** 2) ** 0.5
except TypeEr... | Python | 354 | 32.785309 | 116 | /src/figures.py | 0.577759 | 0.572659 | import pygame
import pygame.draw
import json
import sys
from functools import reduce
import operator
from figures import TextBox, draw_line, draw_point, draw_textbox, draw_rect, draw_circle
from tools import Mode, ColorBox, Auth, Save, FontSizeBox, HandlePoint, HandleLine, HandleText, HandleRect, HandleCircle
import co... | [
"/src/white_board.py",
"/src/serveur.py",
"/src/main.py"
] |
riadghorra/whiteboard-oop-project | refs/heads/master | import socket
import json
import sys
import math
from white_board import WhiteBoard, binary_to_dict
'''
Ouverture de la configuration initiale stockée dans config.json qui contient le mode d'écriture, la couleur et
la taille d'écriture.
Ces Paramètres sont ensuite à modifier par l'utisateur dans l'interface pygame
'... | Python | 62 | 34.112904 | 120 | /src/client.py | 0.707855 | 0.700505 | import socket
import sys
import time
from threading import Thread
import json
'''
Les deux fonctions fonctions suivantes permettent de convertir les dictionnaires en binaire et réciproquement.
L'appel de ces dux fonctions permet d'échanger des dictionnaires par socket
'''
def dict_to_binary(dico):
try:
s... | [
"/src/serveur.py",
"/src/main.py",
"/src/figures.py"
] |
riadghorra/whiteboard-oop-project | refs/heads/master | from white_board import WhiteBoard
import json
'''
This file is used to run locally or to debug
'''
with open('config.json') as json_file:
start_config = json.load(json_file)
def main():
board = WhiteBoard("client", start_config)
board.start_local()
if __name__ == '__main__':
main()
| Python | 18 | 16 | 46 | /src/main.py | 0.647059 | 0.647059 | import socket
import sys
import time
from threading import Thread
import json
'''
Les deux fonctions fonctions suivantes permettent de convertir les dictionnaires en binaire et réciproquement.
L'appel de ces dux fonctions permet d'échanger des dictionnaires par socket
'''
def dict_to_binary(dico):
try:
s... | [
"/src/serveur.py",
"/src/white_board.py",
"/src/tools.py"
] |
riadghorra/whiteboard-oop-project | refs/heads/master | import socket
import sys
import time
from threading import Thread
import json
'''
Les deux fonctions fonctions suivantes permettent de convertir les dictionnaires en binaire et réciproquement.
L'appel de ces dux fonctions permet d'échanger des dictionnaires par socket
'''
def dict_to_binary(dico):
try:
s... | Python | 252 | 37.111111 | 119 | /src/serveur.py | 0.609329 | 0.606518 | import pygame
import pygame.draw
import json
import sys
from functools import reduce
import operator
from figures import TextBox, draw_line, draw_point, draw_textbox, draw_rect, draw_circle
from tools import Mode, ColorBox, Auth, Save, FontSizeBox, HandlePoint, HandleLine, HandleText, HandleRect, HandleCircle
import co... | [
"/src/white_board.py",
"/src/client.py",
"/src/figures.py"
] |
riadghorra/whiteboard-oop-project | refs/heads/master | """
Module contenant les differents outils de gestion du tableau
"""
import pygame
import pygame.draw
from datetime import datetime
from figures import Point, Line, TextBox, Rectangle, Circle
import time
# =============================================================================
# classes de gestion des changemen... | Python | 431 | 36.016243 | 116 | /src/tools.py | 0.564749 | 0.558418 | import socket
import sys
import time
from threading import Thread
import json
'''
Les deux fonctions fonctions suivantes permettent de convertir les dictionnaires en binaire et réciproquement.
L'appel de ces dux fonctions permet d'échanger des dictionnaires par socket
'''
def dict_to_binary(dico):
try:
s... | [
"/src/serveur.py",
"/src/figures.py",
"/src/main.py"
] |
riadghorra/whiteboard-oop-project | refs/heads/master | import pygame
import pygame.draw
import json
import sys
from functools import reduce
import operator
from figures import TextBox, draw_line, draw_point, draw_textbox, draw_rect, draw_circle
from tools import Mode, ColorBox, Auth, Save, FontSizeBox, HandlePoint, HandleLine, HandleText, HandleRect, HandleCircle
import co... | Python | 515 | 39.850487 | 120 | /src/white_board.py | 0.542257 | 0.54007 | from white_board import WhiteBoard
import json
'''
This file is used to run locally or to debug
'''
with open('config.json') as json_file:
start_config = json.load(json_file)
def main():
board = WhiteBoard("client", start_config)
board.start_local()
if __name__ == '__main__':
main()
--- FILE SEP... | [
"/src/main.py",
"/src/figures.py",
"/src/client.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: blogroll
Description :
Author : JHao
date: 2020/10/9
-------------------------------------------------
Change Activity:
2020/10/9:
----------------------------------------------... | Python | 21 | 36.714287 | 121 | /awssam/django-blog/src/django_blog/blogroll.py | 0.42225 | 0.403287 | #rabbitmq and mongodb settings
SCHEDULER = ".rabbitmq.scheduler.Scheduler"
SCHEDULER_PERSIST = True
RABBITMQ_HOST = 'ip address'
RABBITMQ_PORT = 5672
RABBITMQ_USERNAME = 'guest'
RABBITMQ_PASSWORD = 'guest'
MONGODB_PUBLIC_ADDRESS = 'ip:port' # This will be shown on the web interface, but won't be used for connecting t... | [
"/Web-UI/scrapyproject/scrapy_packages/sample_settings.py",
"/myapi/devfile/gitapi/views.py",
"/myapi/fullfeblog/blog/urls.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
class testSpider(RedisSpider):
name = 'testip'
redis_key = 'testip'
def parse(self,response):
response_selector = Selector(response)
code=response_selector.xpath(r'//div[contains(@class,... | Python | 10 | 35.700001 | 88 | /tc_zufang/tc_zufang-slave/tc_zufang/spiders/testip.py | 0.673913 | 0.668478 | from django.http import response
from django.shortcuts import render
from .forms import DocumentForm
import requests
from django.shortcuts import render
from django.conf import settings
from django.core.files.storage import FileSystemStorage
def simple_upload(request):
if request.method == 'POST':
myfile... | [
"/myapi/devfile/gitapi/views.py",
"/awssam/django-blog/src/blog/models.py",
"/myapi/devfile/core/api.py"
] |
mrpal39/ev_code | refs/heads/master | from django.db import models
from tinymce.models import HTMLField
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Post(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
description =HTMLField()
date... | Python | 56 | 22.214285 | 67 | /awssam/ideablog/core/models.py | 0.698999 | 0.686682 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy.item import Item ,Field
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst, MapCompose, Join
class Demo... | [
"/scrap/tuto/tuto/items.py",
"/scrap/tuto/tuto/spiders/callable.py",
"/Web-UI/scrapyproject/urls.py"
] |
mrpal39/ev_code | refs/heads/master | import connection
import queue
from scrapy.utils.misc import load_object
from scrapy.utils.job import job_dir
SCHEDULER_PERSIST = False
QUEUE_CLASS = 'queue.SpiderQueue'
IDLE_BEFORE_CLOSE = 0
class Scheduler(object):
def __init__(self, server, persist,
queue_key, queue_cls, idle_before_close,
... | Python | 73 | 37.698631 | 107 | /Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py | 0.635752 | 0.635044 | # -*- coding: utf-8 -*-
import redis
redis_cli = redis.StrictRedis()
redis_cli.incr("pm_count")
--- FILE SEPARATOR ---
# This script is written under the username admin, with project name Retrofm
# Change the class name AdminRetrofmSpider accordingly
import datetime
_start_date = datetime.date(2012, 12, 25)
_ini... | [
"/eswork/lcvsearch/test.py",
"/Web-UI/examples/link_generator.py",
"/awssam/django-blog/src/django_blog/util.py"
] |
mrpal39/ev_code | refs/heads/master | import scrapy
class MySpider(scrapy.Spider):
name = 'myspider'
start_urls = ['http://example.com']
def parse(self, response):
print(f"Existing settings: {self.settings.attributes.keys()}")
class MyExtension:
def __init__(self, log_is_enabled=False):
if log_is_enabled:
print... | Python | 17 | 27.352942 | 70 | /scrap/tutorial/scrap/spiders/testing.py | 0.638254 | 0.638254 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: urls.py
Description :
Author : JHao
date: 2017/4/13
-------------------------------------------------
Change Activity:
2017/4/13:
-------------------------------------------... | [
"/awssam/django-blog/src/blog/urls.py",
"/Web-UI/examples/scraper.py",
"/Web-UI/scrapyproject/models.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
from tc_zufang.utils.result_parse import list_first_item
from scrapy.http import Request
from tc_zufang.utils.InsertRedis import inserintotc,inserintota
import re
defaultencoding = 'utf-8'
'''
58同城的爬虫
'''
#继承自Redis... | Python | 71 | 42.478874 | 138 | /tc_zufang/tc_zufang/tc_zufang/spiders/tczufang_detail_spider.py | 0.582955 | 0.545366 | from django.conf.urls import url, include
import oauth2_provider.views as oauth2_views
from django.conf import settings
from .views import ApiEndpoint
from django.urls import include, path
# OAuth2 provider endpoints
oauth2_endpoint_views = [
path('authorize/', oauth2_views.AuthorizationView.as_view(), name="autho... | [
"/awssam/iam/users/urls.py",
"/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py",
"/Web-UI/examples/scraper.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
class PropertiesPipeline(object):
def process_item(self, item, spider):
return item
ITEM_PIPELINES = {
'scrapy... | Python | 20 | 22.35 | 65 | /scrap/properties/properties/pipelines.py | 0.706009 | 0.686695 | # You need to create an Item name 'played' for running this script
# item['ack_signal'] = int(response.meta['ack_signal']) - this line is used for sending ack signal to RabbitMQ
def parse(self, response):
item = played()
songs = response.xpath('//li[@class="player-in-playlist-holder"]')
indexr = response.ur... | [
"/Web-UI/examples/scraper.py",
"/myapi/fullfeblog/blog/templatetags/blog_tags.py",
"/myapi/devfile/gitapi/views.py"
] |
mrpal39/ev_code | refs/heads/master | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django.contrib.auth.forms import PasswordChangeForm
class CreateProject(forms.Form):
projectname = forms.SlugField(label="Enter project name", max_length=50, required=True)
helper = FormHelper()
... | Python | 90 | 36.077778 | 147 | /Web-UI/scrapyproject/forms.py | 0.706535 | 0.70024 | from django.conf.urls import url, include
import oauth2_provider.views as oauth2_views
from django.conf import settings
from .views import ApiEndpoint
from django.urls import include, path
# OAuth2 provider endpoints
oauth2_endpoint_views = [
path('authorize/', oauth2_views.AuthorizationView.as_view(), name="autho... | [
"/awssam/iam/users/urls.py",
"/awssam/django-blog/src/django_blog/blogroll.py",
"/awssam/django-blog/src/blog/views.py"
] |
mrpal39/ev_code | refs/heads/master | # Generated by Django 3.1.3 on 2020-11-13 06:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20201113_0620'),
]
operations = [
migrations.AddField(
model_name='feeds',
name='description',
... | Python | 23 | 22.304348 | 50 | /awssam/ideablog/core/migrations/0004_auto_20201113_0633.py | 0.559702 | 0.498134 | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
class testSpider(RedisSpider):
name = 'testip'
redis_key = 'testip'
def parse(self,response):
response_selector = Selector(response)
code=response_selector.xpath(r'//div[contains(@class,... | [
"/tc_zufang/tc_zufang-slave/tc_zufang/spiders/testip.py",
"/Web-UI/scrapyproject/forms.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py"
] |
mrpal39/ev_code | refs/heads/master | from django.conf.urls import url, include
import oauth2_provider.views as oauth2_views
from django.conf import settings
from .views import ApiEndpoint
from django.urls import include, path
# OAuth2 provider endpoints
oauth2_endpoint_views = [
path('authorize/', oauth2_views.AuthorizationView.as_view(), name="autho... | Python | 35 | 44.857143 | 114 | /awssam/iam/users/urls.py | 0.702181 | 0.689097 |
from haystack import indexes
from django . conf import settings
from .models import Article ,Category ,Tag
class ArticleIndex ( indexes . SearchIndex , indexes . Indexable ):
text = indexes . CharField ( document = True , use_template = True )
def get_model ( self ):
return Art... | [
"/myapi/fullfeblog/blog/search_indexes.py",
"/scrap/properties/properties/spiders/basictest.py",
"/scrap/properties/properties/pipelines.py"
] |
mrpal39/ev_code | refs/heads/master | from django.http import HttpResponse, Http404
from django.shortcuts import render
import datetime
from django.http import HttpResponseRedirect
from django.core.mail import send_mail
from django.contrib.auth.views import login as loginview
from registration.backends.simple import views
from django.contrib.auth import au... | Python | 67 | 30.194031 | 107 | /Web-UI/mysite/views.py | 0.677033 | 0.673684 |
from django import template
from django.db.models import Q
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
import random
from django.urls import reverse
# from blog.models import Article, Category, Tag, Links, SideBar, LinkShowType
... | [
"/myapi/fullfeblog/blog/blog_tags.py",
"/cte/properties/properties/spiders/basic.py",
"/myapi/devfile/request/api1.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scrapyproject', '0004_pipeline_pipeline_function'),
]
operations = [
migrations.RemoveField(
model_name='project... | Python | 28 | 23.785715 | 61 | /Web-UI/scrapyproject/migrations/0005_auto_20170213_1053.py | 0.56196 | 0.554755 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth import update_session_auth_hash
from .forms import CreateProject, DeleteProject, ItemName, FieldName, CreatePipeline, LinkGenerator, Scraper, Settings, ShareDB, ChangePass, ShareProject
from django.htt... | [
"/Web-UI/scrapyproject/views.py",
"/awssam/fullfeblog/blog/feeds.py",
"/scrap/properties/properties/items.py"
] |
mrpal39/ev_code | refs/heads/master | # Generated by Django 3.1.3 on 2020-11-14 04:52
from django.db import migrations, models
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_feeds_content'),
]
operations = [
migrations.CreateModel(
name='MyModel',
fields=... | Python | 29 | 24.379311 | 114 | /awssam/ideablog/core/migrations/0006_auto_20201114_0452.py | 0.540761 | 0.514946 | # from core.models import Item
from django.shortcuts import render
# from django.views.generic import ListView,DetailView
from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import Post
from django.views.generic import (
ListV... | [
"/myapi/fullfeblog/blog/views.py",
"/scrap/tutorial/scrap/spiders/reactor.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/utils/message.py"
] |
mrpal39/ev_code | refs/heads/master | # This script is written under the username admin, with project name Retrofm
# Change the class name AdminRetrofmSpider accordingly
import datetime
_start_date = datetime.date(2012, 12, 25)
_initial_date = datetime.date(2012, 12, 25)
_priority = 0
start_urls = ['http://retrofm.ru']
def parse(self, response):
whi... | Python | 26 | 45.23077 | 109 | /Web-UI/examples/link_generator.py | 0.669442 | 0.620316 |
import os
from django.urls import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'vsfygxju9)=k8qxmc9!__ng%dooyn-w7il_z+w)grvkz4ks!)u'
# SECURITY WARNING: don't run with debug turned on in produ... | [
"/awssam/wikidj/wikidj/settings.py",
"/march19/devfile/api/urls.py",
"/cte/properties/properties/spiders/webi.py"
] |
mrpal39/ev_code | refs/heads/master | from django import forms
#Building a search view
class SearchForm(forms.Form):
query =forms.CharField()
class uploadForm(forms.ModelForm):
images=forms.ImageField()
# # from .forms import EmailPostForm, CommentForm , SearchForm
# User Repositories='https://libraries.io/api/github/:login/repositories?... | Python | 30 | 51.833332 | 125 | /myapi/devfile/core/forms.py | 0.768939 | 0.616793 | # -*- coding: utf-8 -*-
#如果没有下一页的地址则返回none
list_first_item = lambda x:x[0] if x else None
--- FILE SEPARATOR ---
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'f!7k7a9k10)fbx7#@y@u9u@v3%b)f%h6xxnxf71(21z1uj^#+e'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
... | [
"/tc_zufang/tc_zufang-slave/tc_zufang/utils/result_parse.py",
"/awssam/iam/iam/settings.py",
"/awssam/django-blog/src/blog/admin.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
#如果没有下一页的地址则返回none
list_first_item = lambda x:x[0] if x else None
| Python | 4 | 21.75 | 46 | /tc_zufang/tc_zufang-slave/tc_zufang/utils/result_parse.py | 0.659341 | 0.637363 | # -*- coding: utf-8 -*-
res=u'\u4e30\u6cf0\u57ce'
# rr=res.encode('gbk')
print res
--- FILE SEPARATOR ---
# -*- coding: utf-8 -*-
from pymongo import MongoClient
from scrapy import log
import traceback
from scrapy.exceptions import DropItem
class SingleMongodbPipeline(object):
MONGODB_SERVER = "101.200.46.191"
... | [
"/tc_zufang/django_web/django_web/test.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py",
"/cte/properties/properties/items.py"
] |
mrpal39/ev_code | refs/heads/master | from django import forms
from core.models import Comment
#Building a search view
class SearchForm(forms.Form):
query =forms.CharField()
class EmailPostForm(forms.Form):
name = forms.CharField(max_length=25)
email = forms.EmailField()
to = forms.EmailField()
comments = forms.CharField(required=... | Python | 35 | 25.542856 | 57 | /myapi/fullfeblog/blog/forms.py | 0.59375 | 0.586207 | from django.http import HttpResponse, Http404
from django.shortcuts import render
import datetime
from django.http import HttpResponseRedirect
from django.core.mail import send_mail
from django.contrib.auth.views import login as loginview
from registration.backends.simple import views
from django.contrib.auth import au... | [
"/Web-UI/mysite/views.py",
"/awssam/iam/users/urls.py",
"/Web-UI/examples/scraper.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
# Create your views here.
import json
from django.http import JsonResponse
from django_blog.util import PageInfo
from blog.models import Article, Comment
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, get_object_or_404
def get_page(request):
page... | Python | 144 | 29.847221 | 111 | /awssam/django-blog/src/blog/views.py | 0.61819 | 0.612112 | import connection
import queue
from scrapy.utils.misc import load_object
from scrapy.utils.job import job_dir
SCHEDULER_PERSIST = False
QUEUE_CLASS = 'queue.SpiderQueue'
IDLE_BEFORE_CLOSE = 0
class Scheduler(object):
def __init__(self, server, persist,
queue_key, queue_cls, idle_before_close,
... | [
"/Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py",
"/scrap/tuto/tuto/spiders/scrapy.py",
"/myapi/fullfeblog/blog/views.py"
] |
mrpal39/ev_code | refs/heads/master |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from taggit.managers import TaggableManager
from django.urls import reverse
import logging
from abc import ABCMeta, abstractmethod, abstractproperty
from django.db import models
from django.urls import reverse
f... | Python | 407 | 32.624077 | 112 | /myapi/fullfeblog/blog/models.py | 0.559664 | 0.551626 | import connection
import queue
from scrapy.utils.misc import load_object
from scrapy.utils.job import job_dir
SCHEDULER_PERSIST = False
QUEUE_CLASS = 'queue.SpiderQueue'
IDLE_BEFORE_CLOSE = 0
class Scheduler(object):
def __init__(self, server, persist,
queue_key, queue_cls, idle_before_close,
... | [
"/Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py",
"/awssam/iam/users/urls.py",
"/eswork/articles/articles/spiders/pm_spider.py"
] |
mrpal39/ev_code | refs/heads/master |
import os
from django.urls import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'vsfygxju9)=k8qxmc9!__ng%dooyn-w7il_z+w)grvkz4ks!)u'
# SECURITY WARNING: don't run with debug turned on in produ... | Python | 140 | 27.185715 | 91 | /awssam/wikidj/wikidj/settings.py | 0.68145 | 0.676635 |
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.views.generic import (
ListView,
DetailView,
CreateView,
UpdateView,
DeleteView
)
from .models import Post, P... | [
"/awssam/ideablog/core/views.py",
"/scrap/tuto/tuto/spiders/dataviaHTTPPOST.py",
"/cte/properties/properties/items.py"
] |
mrpal39/ev_code | refs/heads/master | from django.db import models
from blog.models import Post
# Creating a comment systems
class Comment(models.Model):
post = models.ForeignKey(Post,
on_delete=models.CASCADE,
related_name='comments')
name=models.CharField(max_length=200)
email=models.EmailField()
body... | Python | 19 | 31.31579 | 53 | /awssam/fullfeblog/core/models.py | 0.661316 | 0.656501 | from django.conf.urls import url
from . import views
urlpatterns = [
url('api/', views.apiurl, name='index'),
]
--- FILE SEPARATOR ---
from haystack import indexes
from django . conf import settings
from .models import Article ,Category ,Tag
class ArticleIndex ( indexes . SearchIndex , indexes ... | [
"/march19/devfile/api/urls.py",
"/myapi/fullfeblog/blog/search_indexes.py",
"/myapi/fullfeblog/blog/templatetags/blog_tags.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from mongoengine import *
from django.db import models
# Create your models here.
class ItemInfo(Document):
# 帖子名称
title = StringField()
# 租金
money = StringField()
# 租赁方式
method = StringField()
# 所在区域
area = StringField()
... | Python | 28 | 20.785715 | 39 | /tc_zufang/django_web/datashow/models.py | 0.619672 | 0.614754 | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
class testSpider(RedisSpider):
name = 'testip'
redis_key = 'testip'
def parse(self,response):
response_selector = Selector(response)
code=response_selector.xpath(r'//div[contains(@class,... | [
"/tc_zufang/tc_zufang-slave/tc_zufang/spiders/testip.py",
"/cte/properties/properties/spiders/basic.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/utils/GetProxyIp.py"
] |
mrpal39/ev_code | refs/heads/master | from django.urls import path
from . import views
urlpatterns = [
path('', views.api, name='api'),
path('t/', views.simple_upload, name='test'),
]
| Python | 10 | 15.2 | 49 | /myapi/devfile/gitapi/urls.py | 0.611111 | 0.611111 | from django.contrib import admin
from .models import Project, Item, Field, Pipeline
# Register your models here.
admin.site.register(Project)
admin.site.register(Item)
admin.site.register(Field)
admin.site.register(Pipeline)
--- FILE SEPARATOR ---
# -*- coding: utf-8 -*-
from pymongo import MongoClient
from scrapy i... | [
"/Web-UI/scrapyproject/admin.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py",
"/Web-UI/scrapyproject/models.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
#定义需要抓取存进数据库的字段
from scrapy.item import Item,Field
class TcZufangItem(Item):
#帖子名称
title=Field()
#租金
money=Field()
#租赁方式
method=Field()
#所在区域
area=Field()
#所在小区
community=Field()
#帖子详情url
targeturl=Field()
#帖子发布时间
pub_time=Field()
#所在城市... | Python | 26 | 15.384615 | 34 | /tc_zufang/tc_zufang-slave/tc_zufang/items.py | 0.550117 | 0.538462 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: urls.py
Description :
Author : JHao
date: 2017/4/13
-------------------------------------------------
Change Activity:
2017/4/13:
-------------------------------------------... | [
"/awssam/django-blog/src/blog/urls.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py",
"/Web-UI/examples/link_generator.py"
] |
mrpal39/ev_code | refs/heads/master | from scrapy.loader.processors import MapCompose, Join
from scrapy.loader import ItemLoader
from properties.items import PropertiesItem
import datetime
from urllib.parse import urlparse
import socket
import scrapy
class BasicSpider(scrapy.Spider):
name = "basictest"
allowed_domains = ["web"]
start_urls=(
... | Python | 42 | 44.023811 | 299 | /scrap/properties/properties/spiders/basictest.py | 0.690476 | 0.67037 | from django.urls import path,include
from blog import views
urlpatterns = [
# path('', views.index, name='base'),
path('', views.list, name='list'),
# path('home/', views.home, name='home'),
# path('search/', views.Search, name='home_search'),
# path('', views.home, name='home'),
]
--- FI... | [
"/myapi/devfile/blog/urls.py",
"/Web-UI/scrapyproject/admin.py",
"/myapi/devfile/request/api.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import logging
# import MySQLdb
# import MySQLdb.cursors
import copy
import pymysql
from twisted.enterprise import adbapi
#... | Python | 75 | 27.933332 | 117 | /eswork/articles/articles/pipelines.py | 0.605069 | 0.604608 | import scrapy
class MySpider(scrapy.Spider):
name = 'myspider'
start_urls = ['http://example.com']
def parse(self, response):
print(f"Existing settings: {self.settings.attributes.keys()}")
class MyExtension:
def __init__(self, log_is_enabled=False):
if log_is_enabled:
print... | [
"/scrap/tutorial/scrap/spiders/testing.py",
"/awssam/tutorial/api.py",
"/awssam/django-blog/src/blog/admin.py"
] |
mrpal39/ev_code | refs/heads/master | # import requests
# url = "https://proxy-orbit1.p.rapidapi.com/v1/"
# headers = {
# 'x-rapidapi-key': "b188eee73cmsha4c027c9ee4e2b7p1755ebjsn1e0e0b615bcf",
# 'x-rapidapi-host': "proxy-orbit1.p.rapidapi.com"
# }
# # response = requests.request("GET", url, headers=headers)
# print(response.text)
import reque... | Python | 47 | 23.659575 | 143 | /myapi/devfile/request/api.py | 0.714901 | 0.633075 | from fpdf import FPDF
from PIL import Image
import you
import os
pdf = FPDF ()
imagelist = [] # Contains the list of all images to be converted to PDF.
# --------------- USER INPUT -------------------- #
folder = "/home/rudi/Documents/Pictures/1.png... | [
"/myapi/devfile/gitapi/jp.py",
"/scrap/tuto/tuto/items.py",
"/awssam/ideablog/core/models.py"
] |
mrpal39/ev_code | refs/heads/master | from django.urls import path
from . import views
from django.conf.urls import include, url
from django.views import generic
from material.frontend import urls as frontend_urls
urlpatterns = [
path('', views.home, name='home'),
path('$/', generic.RedirectView.as_view(url='/workflow/', permanent=False)),
pat... | Python | 25 | 24.440001 | 80 | /awssam/devfile/core/urls.py | 0.690738 | 0.690738 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scrapyproject', '0004_pipeline_pipeline_function'),
]
operations = [
migrations.RemoveField(
model_name='project... | [
"/Web-UI/scrapyproject/migrations/0005_auto_20170213_1053.py",
"/awssam/tutorial/api.py",
"/cte/properties/properties/spiders/webi.py"
] |
mrpal39/ev_code | refs/heads/master | # You need to create an Item name 'played' for running this script
# item['ack_signal'] = int(response.meta['ack_signal']) - this line is used for sending ack signal to RabbitMQ
def parse(self, response):
item = played()
songs = response.xpath('//li[@class="player-in-playlist-holder"]')
indexr = response.ur... | Python | 16 | 50.4375 | 110 | /Web-UI/examples/scraper.py | 0.619221 | 0.611922 | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
from tc_zufang.utils.result_parse import list_first_item
from scrapy.http import Request
from tc_zufang.items import TcZufangItem
import re
defaultencoding = 'utf-8'
'''
58同城的爬虫
'''
#继承自RedisSpider,则start_urls可以从re... | [
"/tc_zufang/tc_zufang-slave/tc_zufang/spiders/tczufang_detail_spider.py",
"/Web-UI/scrapyproject/scrapy_packages/rabbitmq/connection.py",
"/Web-UI/scrapyproject/scrapy_packages/sample_settings.py"
] |
mrpal39/ev_code | refs/heads/master | # from __future__ import unicode_literals
# from django.utils.encoding import python_2_unicode_compatible
# from django.db import models
# from django.db.models.signals import pre_delete
# from django.dispatch import receiver
# from scrapy_djangoitem import DjangoItem
# from dynamic_scraper.models import Scraper, Sched... | Python | 48 | 34.166668 | 109 | /awssam/myscrapyproject/scrapyapi/srp/models.py | 0.696503 | 0.689389 | # -*- coding: utf-8 -*-
from pymongo import MongoClient
from scrapy import log
import traceback
from scrapy.exceptions import DropItem
class SingleMongodbPipeline(object):
MONGODB_SERVER = "101.200.46.191"
MONGODB_PORT = 27017
MONGODB_DB = "zufang_fs"
def __init__(self):
#初始化mongodb连接
... | [
"/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py",
"/scrap/properties/properties/pipelines.py",
"/awssam/wikidj/wikidj/settings.py"
] |
mrpal39/ev_code | refs/heads/master | from django.shortcuts import render
from .forms import SearchForm
import requests
def base(request):
# import requests
# # url = "https://gplaystore.p.rapidapi.com/newFreeApps"
# url="https://libraries.io/api/"
# querystring = {"platforms":"NPM/base62"}
# headers = {'x-rapidapi-key': "?api_key=30... | Python | 79 | 29.772152 | 123 | /myapi/devfile/core/views.py | 0.621677 | 0.557055 | from django.conf.urls import url, include
import oauth2_provider.views as oauth2_views
from django.conf import settings
from .views import ApiEndpoint
from django.urls import include, path
# OAuth2 provider endpoints
oauth2_endpoint_views = [
path('authorize/', oauth2_views.AuthorizationView.as_view(), name="autho... | [
"/awssam/iam/users/urls.py",
"/Web-UI/mysite/views.py",
"/awssam/ideablog/core/migrations/0004_auto_20201113_0633.py"
] |
mrpal39/ev_code | refs/heads/master | from django.http import response
from django.shortcuts import render
from .forms import DocumentForm
import requests
from django.shortcuts import render
from django.conf import settings
from django.core.files.storage import FileSystemStorage
def simple_upload(request):
if request.method == 'POST':
myfile... | Python | 67 | 21.328358 | 82 | /myapi/devfile/gitapi/views.py | 0.626915 | 0.614257 | from django.contrib import admin
from .models import Products,feeds,MyModel,Post
# Register your models here.
admin.site.register(Products)
admin.site.register(feeds)
admin.site.register(MyModel)
admin.site.register(Post)
--- FILE SEPARATOR ---
import collections
from scrapy.exceptions import DropItem
from scrapy.... | [
"/awssam/ideablog/core/admin.py",
"/scrap/tuto/tuto/pipelines.py",
"/tc_zufang/tc_zufang-slave/tc_zufang/spiders/testip.py"
] |
mrpal39/ev_code | refs/heads/master | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth import update_session_auth_hash
from .forms import CreateProject, DeleteProject, ItemName, FieldName, CreatePipeline, LinkGenerator, Scraper, Settings, ShareDB, ChangePass, ShareProject
from django.htt... | Python | 1,663 | 42.61335 | 181 | /Web-UI/scrapyproject/views.py | 0.59794 | 0.594783 | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy import Item, Field
# define the fields for your item here like:
#
class SainsburysItem(scrapy.Item):
name = scrapy.Field()
class SainsburysItem(Item):... | [
"/cte/projectfile/projectfile/items.py",
"/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py",
"/myapi/devfile/core/forms.py"
] |
mrpal39/ev_code | refs/heads/master | from django.contrib import admin
from .models import Products,feeds,MyModel,Post
# Register your models here.
admin.site.register(Products)
admin.site.register(feeds)
admin.site.register(MyModel)
admin.site.register(Post)
| Python | 9 | 23.888889 | 47 | /awssam/ideablog/core/admin.py | 0.8125 | 0.8125 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: urls.py
Description :
Author : JHao
date: 2017/4/13
-------------------------------------------------
Change Activity:
2017/4/13:
-------------------------------------------... | [
"/awssam/django-blog/src/blog/urls.py",
"/awssam/fullfeblog/core/models.py",
"/awssam/django-blog/src/blog/templatetags/custom_filter.py"
] |
mrpal39/ev_code | refs/heads/master | from django.contrib import admin
# Register your models here.
from blog.models import Tag, Article, Category
@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
date_hierarchy = 'date_time'
list_display = ('title', 'category', 'author', 'date_time', 'view')
list_filter = ('category', 'author... | Python | 24 | 19.75 | 71 | /awssam/django-blog/src/blog/admin.py | 0.706827 | 0.706827 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import redis
import scrapy
import datetime
from scrapy.loader.processors import MapCompose
from articles.model.es_types import ArticleType
from elasticsearch_dsl.con... | [
"/eswork/articles/articles/items.py",
"/awssam/iam/users/views.py",
"/scrap/tuto/tuto/spiders/callable.py"
] |
mrpal39/ev_code | refs/heads/master |
from django import template
from django.db.models import Q
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
import random
from django.urls import reverse
# from blog.models import Article, Category, Tag, Links, SideBar, LinkShowType
... | Python | 52 | 25.346153 | 78 | /myapi/fullfeblog/blog/blog_tags.py | 0.750547 | 0.748359 | from django.db import models
from django.contrib.auth.models import User
class Project(models.Model):
project_name = models.CharField(max_length=50)
user = models.ForeignKey(User)
link_generator = models.TextField(blank=True)
scraper_function = models.TextField(blank=True)
settings_scraper = model... | [
"/Web-UI/scrapyproject/models.py",
"/awssam/django-blog/src/blog/urls.py",
"/scrap/properties/properties/pipelines.py"
] |
mrpal39/ev_code | refs/heads/master | import scrapy
class DemoSpider(scrapy.Spider):
name = 'demo'
start_urls = ['http://www.something.com/users/login.php']
def parse(self, response):
return scrapy.FormRequest.from_response(
response,
formdata = {'username': 'admin', 'password': 'confidential'},
callback ... | Python | 16 | 32.875 | 69 | /scrap/tuto/tuto/spiders/dataviaHTTPPOST.py | 0.608133 | 0.608133 | from scrapy.loader.processors import MapCompose, Join
from scrapy.loader import ItemLoader
from properties.items import PropertiesItem
import datetime
from urllib.parse import urlparse
import socket
import scrapy
class BasicSpider(scrapy.Spider):
name = "basictest"
allowed_domains = ["web"]
start_urls=(
... | [
"/scrap/properties/properties/spiders/basictest.py",
"/awssam/ideablog/core/models.py",
"/awssam/ideablog/core/migrations/0004_auto_20201113_0633.py"
] |
mrpal39/ev_code | refs/heads/master | from django.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.sitemaps.views import sitemap
from blog.sitemaps import PostSitemap
from django.conf.urls import url, include
# from .. import core
sitemaps={
'posts'... | Python | 24 | 31.416666 | 65 | /myapi/fullfeblog/webdev/urls.py | 0.70399 | 0.70399 |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from taggit.managers import TaggableManager
from django.urls import reverse
import logging
from abc import ABCMeta, abstractmethod, abstractproperty
from django.db import models
from django.urls import reverse
f... | [
"/myapi/fullfeblog/blog/models.py",
"/awssam/django-blog/src/blog/admin.py",
"/myapi/fullfeblog/blog/blog_tags.py"
] |
mrpal39/ev_code | refs/heads/master | # -*- coding: utf-8 -*-
import random
import requests
def GetIps():
li=[]
global count
url ='http://139.199.182.250:8000/?types=0&count=300'
ips=requests.get(url)
for ip in eval(ips.content):
li.append(ip[0]+':'+ip[1])
return li
GetIps()
| Python | 13 | 19.76923 | 56 | /tc_zufang/tc_zufang-slave/tc_zufang/utils/GetProxyIp.py | 0.592593 | 0.511111 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: models.py
Description :
Author : JHao
date: 2016/11/18
-------------------------------------------------
Change Activity:
2016/11/18:
--------------------------------------------... | [
"/awssam/django-blog/src/blog/models.py",
"/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py",
"/awssam/myscrapyproject/scrapyapi/srp/models.py"
] |
mrpal39/ev_code | refs/heads/master |
from .settings import *
from .dev import *
# Test codehilite with pygments
WIKI_MARKDOWN_KWARGS = {
"extensions": [
"codehilite",
"footnotes",
"attr_list",
"headerid",
"extra",
]
} | Python | 13 | 16.76923 | 31 | /awssam/wikidj/wikidj/codehilite.py | 0.541126 | 0.541126 | from django.contrib import admin
# Register your models here.
from blog.models import Tag, Article, Category
@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
date_hierarchy = 'date_time'
list_display = ('title', 'category', 'author', 'date_time', 'view')
list_filter = ('category', 'author... | [
"/awssam/django-blog/src/blog/admin.py",
"/myapi/fullfeblog/blog/models.py",
"/awssam/django-blog/src/blog/context_processors.py"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.