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
mrpal39/ev_code
refs/heads/master
from datetime import datetime from scrapy.spiders import SitemapSpider class FilteredSitemapSpider(SitemapSpider): name = 'filtered_sitemap_spider' allowed_domains = ['example.com'] sitemap_urls = ['http://example.com/sitemap.xml'] def sitemap_filter(self, entries): for entry in entries: ...
Python
13
33.923077
71
/scrap/tutorial/scrap/spiders/SitemapSpider.py
0.653422
0.644592
mrpal39/ev_code
refs/heads/master
"""mysite 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.home, name='home') Class-base...
Python
27
40.037037
81
/Web-UI/mysite/urls.py
0.704874
0.698556
mrpal39/ev_code
refs/heads/master
from django.contrib.sitemaps import Sitemap from . models import Post class PostSitemap(Sitemap): changefreq='weekly' # You create a custom sitemap by inheriting the Sitemap class of the sitemaps priority = 0.9 # module. The changefreq and priority attributes indicate the change frequency # of ...
Python
17
29.235294
103
/awssam/fullfeblog/blog/sitemaps.py
0.699809
0.694073
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- import re import json import scrapy import copy from articles.items import PmArticlesItem from articles.utils.common import date_convert class PmSpiderSpider(scrapy.Spider): name = 'pm_spider' allowed_domains = ['woshipm.com'] # start_urls = ['http://www.woshipm.com/__api/v1/stream...
Python
44
37.795456
117
/eswork/articles/articles/spiders/pm_spider.py
0.546838
0.542155
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- import scrapy from properties.items import PropertiesItem class BasicSpider(scrapy.Spider): name = 'basic' allowed_domains = ['web'] start_urls = ( # 'http://web:9312/properties/property_000000.html', # 'https://www.coreapi.org/#examples', # 'https://www.free...
Python
71
39.985916
100
/scrap/properties/properties/spiders/basic.py
0.5029
0.489253
mrpal39/ev_code
refs/heads/master
# 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...
Python
164
28.323172
103
/awssam/fullfeblog/blog/views.py
0.590559
0.587024
mrpal39/ev_code
refs/heads/master
import scrapy class PySpider(scrapy.Spider): name = 'quots' # start_urls = [ def start_requests(self): urls=['https://pypi.org/'] for url in urls: yield scrapy.Request(url=url, callback=self.parse) # return super().start_requests()() def parse(self, response): ...
Python
30
20
65
/scrap/tutorial/scrap/spiders/spider.py
0.562401
0.559242
mrpal39/ev_code
refs/heads/master
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...
Python
137
18.467154
78
/awssam/ideablog/core/views.py
0.691789
0.688789
mrpal39/ev_code
refs/heads/master
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...
Python
48
44.020832
137
/myapi/devfile/gitapi/jp.py
0.441462
0.429431
mrpal39/ev_code
refs/heads/master
# -*- 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连接 ...
Python
63
37.84127
89
/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py
0.551104
0.533115
mrpal39/ev_code
refs/heads/master
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...
Python
59
29.864407
67
/Web-UI/scrapyproject/models.py
0.715934
0.709341
mrpal39/ev_code
refs/heads/master
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...
Python
13
33.46154
76
/myapi/fullfeblog/blog/search_indexes.py
0.623608
0.623608
mrpal39/ev_code
refs/heads/master
# -*- 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...
Python
65
27.861538
120
/eswork/articles/articles/items.py
0.630261
0.627597
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- import redis redis_cli = redis.StrictRedis() redis_cli.incr("pm_count")
Python
6
15.333333
31
/eswork/lcvsearch/test.py
0.646465
0.636364
mrpal39/ev_code
refs/heads/master
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 = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions...
Python
129
26.496124
91
/awssam/iam/iam/settings.py
0.664694
0.658777
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- try: import pika except ImportError: raise ImportError("Please install pika before running scrapy-rabbitmq.") RABBITMQ_CONNECTION_TYPE = 'blocking' RABBITMQ_CONNECTION_PARAMETERS = {'host': 'localhost'} def from_settings(settings, spider_name): connection_type = settings.get('R...
Python
47
30.510639
77
/Web-UI/scrapyproject/scrapy_packages/rabbitmq/connection.py
0.655638
0.653612
mrpal39/ev_code
refs/heads/master
from django.conf.urls import url from . import views urlpatterns = [ url('api/', views.apiurl, name='index'), ]
Python
7
15.857142
44
/march19/devfile/api/urls.py
0.675214
0.675214
mrpal39/ev_code
refs/heads/master
from django.http.response import HttpResponse from requests_oauthlib import OAuth2Session import json import requests_oauthlib from django.HttpResponse import request import requests from django.shortcuts import redirect, session, # payload={'key1':'search?q=','key2':['form','&api_key=306cf1684a42e4be5ec0a1c60362...
Python
38
30.236841
91
/myapi/devfile/core/api.py
0.72437
0.688235
mrpal39/ev_code
refs/heads/master
from django import template from ..models import Post from django.utils.safestring import mark_safe import markdown from django.db.models import Count register = template.Library() @register.filter(name='markdown') def markdown_fromat(text): return mark_safe(markdown.markdown(text)) @register.simple_tag def tota...
Python
33
33.666668
83
/myapi/fullfeblog/blog/templatetags/blog_tags.py
0.755906
0.754156
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', '0008_scrapersdeploy'), ] operations = [ migrations.AddField( model_name='linkgendeploy', ...
Python
24
22.666666
49
/Web-UI/scrapyproject/migrations/0009_auto_20170215_0657.py
0.573944
0.56162
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- import redis def inserintotc(str,type): try: r = redis.Redis(host='127.0.0.1', port=6379, db=0) except: print '连接redis失败' else: if type == 1: r.lpush('start_urls', str) def inserintota(str,type): try: r = redis.Redis(host='127.0.0.1', p...
Python
18
24.277779
58
/tc_zufang/tc_zufang/tc_zufang/utils/InsertRedis.py
0.528634
0.473568
mrpal39/ev_code
refs/heads/master
from django.apps import AppConfig class CorescrapConfig(AppConfig): name = 'corescrap'
Python
5
17.6
33
/awssam/myscrapyproject/dev/corescrap/apps.py
0.763441
0.763441
mrpal39/ev_code
refs/heads/master
# -*- 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...
Python
29
24.275862
66
/scrap/tuto/tuto/items.py
0.709413
0.708049
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.items import TcZufangItem import re defaultencoding = 'utf-8' ''' 58同城的爬虫 ''' #继承自RedisSpider,则start_urls可以从re...
Python
87
41.873562
195
/tc_zufang/tc_zufang-slave/tc_zufang/spiders/tczufang_detail_spider.py
0.600965
0.581121
mrpal39/ev_code
refs/heads/master
# Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html import scrapy from scrapy.item import Item,Field class PropertiesItem(): title=Field() price=Field() description=Field() address = Field() image_urls = Field() #im...
Python
26
18.038462
53
/cte/properties/properties/items.py
0.655242
0.655242
mrpal39/ev_code
refs/heads/master
# 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...
Python
272
28.94853
103
/myapi/fullfeblog/blog/views.py
0.587528
0.582863
mrpal39/ev_code
refs/heads/master
import scrapy class FirstScrapyItem(scrapy.Item): # define the fields for your item here like: item=DmozItem() item ['title'] = scrapy.Field() item ['url'] = scrapy.Field() item ['desc'] = scrapy.Field()
Python
11
20.181818
48
/scrap/first_scrapy/first_scrapy/items.py
0.606695
0.606695
mrpal39/ev_code
refs/heads/master
import hashlib import datetime def date_convert(value): # 日期转化 try: create_date = datetime.datetime.strptime(value, "%Y/%m/%d").date() except Exception as e: print(e) create_date = datetime.datetime.now().date() return create_date def get_md5(url): # url md5加密 if is...
Python
27
19.962963
74
/eswork/articles/articles/utils/common.py
0.59612
0.560847
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- res=u'\u4e30\u6cf0\u57ce' # rr=res.encode('gbk') print res
Python
4
19.75
25
/tc_zufang/django_web/django_web/test.py
0.621951
0.52439
mrpal39/ev_code
refs/heads/master
from django.shortcuts import render from urllib.request import urlopen from django.shortcuts import render from django.views import View import requests # class apiurl(View): def apiurl(request): url =requests('https://api.github.com/') data=url.requests.json() context ={ 'data':data } ...
Python
17
20.882353
48
/march19/devfile/api/views.py
0.692513
0.692513
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- import smtplib from email.mime.text import MIMEText from email.header import Header def sendMessage_warning(): server = smtplib.SMTP('smtp.163.com', 25) server.login('seven_2016@163.com', 'ssy102009') msg = MIMEText('爬虫slave被封警告!请求解封!', 'plain', 'utf-8') msg['From'] = 'seven_2016...
Python
12
38.333332
60
/tc_zufang/tc_zufang-slave/tc_zufang/utils/message.py
0.620763
0.591102
mrpal39/ev_code
refs/heads/master
# 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):...
Python
45
22.133333
53
/cte/projectfile/projectfile/items.py
0.589817
0.589817
mrpal39/ev_code
refs/heads/master
from . settings import * DEBUG = True for template_engine in TEMPLATES: template_engine["OPTIONS"]["debug"] = True EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" try: import debug_toolbar # @UnusedImport MIDDLEWARE = list(MIDDLEWARE) + [ "debug_toolbar.middleware.DebugToolb...
Python
22
22.818182
64
/awssam/wikidj/wikidj/dev.py
0.688336
0.676864
mrpal39/ev_code
refs/heads/master
import logging import scrapy logger = logging.getLogger('mycustomlogger') class MySpider(scrapy.Spider): name = 'myspider1' start_urls = ['https://scrapinghub.com'] def parse(self, response): logger.info('Parse function called on %s', response.url)
Python
12
21.75
64
/scrap/tutorial/scrap/spiders/reactor.py
0.698529
0.694853
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-02-24 08:54 from __future__ import unicode_literals from django.db import migrations, models import open_news.models class Migration(migrations.Migration): dependencies = [ ('open_news', '0001_initial'), ] operations = [ migr...
Python
23
26.173914
114
/scrap/example_project/open_news/migrations/0002_document.py
0.5952
0.56
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- from django.shortcuts import render from . models import ItemInfo from django.core.paginator import Paginator from mongoengine import connect connect("zufang_fs",host='127.0.0.1') # Create your views here. def document(request): limit=15 zufang_info=ItemInfo.objects pageinator=Pagina...
Python
86
26.023256
55
/tc_zufang/django_web/datashow/views.py
0.583728
0.568661
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: context_processors.py Description : Author : JHao date: 2017/4/14 ------------------------------------------------- Change Activity: 2017/4/14: -----------------------------...
Python
47
21.106382
89
/awssam/django-blog/src/blog/context_processors.py
0.481232
0.462945
mrpal39/ev_code
refs/heads/master
import requests import json url='https://www.scraping-bot.io/rawHtmlPage.html' username = 'yourUsername' apiKey = 'yourApiKey' apiUrl = "http://api.scraping-bot.io/scrape/raw-html" payload = json.dumps({"url":url}) headers = { 'Content-Type': "application/json" } response = requests.request("POST", apiUrl, data...
Python
64
30.359375
188
/myapi/devfile/request/api1.py
0.736291
0.716351
mrpal39/ev_code
refs/heads/master
from django import forms from .models import Products class productForm(forms.ModelForm): class Meta: model=Products fields=['title','description','price']
Python
13
12
40
/awssam/ideablog/core/forms.py
0.738095
0.738095
mrpal39/ev_code
refs/heads/master
import scrapy def authentication_failed(response): pass class LoginSpider(scrapy.Spider): name='ex' start_urls=['https://www.facebook.com/login.php'] def parse(self,response): return scrapy.FormRequest.from_response( response,formdata={'username':'john','password':'secret'}, ...
Python
30
22.033333
74
/scrap/tutorial/scrap/spiders/login.py
0.587896
0.586455
mrpal39/ev_code
refs/heads/master
#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...
Python
20
40.950001
117
/Web-UI/scrapyproject/scrapy_packages/sample_settings.py
0.727056
0.651967
mrpal39/ev_code
refs/heads/master
from django.conf.urls import include, url from . import views urlpatterns = [ url(r'^$', views.main_page, name="mainpage"), url(r'^create/$', views.create_new, name="newproject"), url(r'^manage/(?P<projectname>[\w]+)/', views.manage_project, name="manageproject"), url(r'^delete/(?P<projectname>[\w]+)/'...
Python
34
80.147057
121
/Web-UI/scrapyproject/urls.py
0.654097
0.654097
mrpal39/ev_code
refs/heads/master
# Generated by Django 3.1.3 on 2020-11-13 06:20 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0002_products'), ] operations = [ migrations.RenameModel( old_name='Post', new_name='feeds', ), ]
Python
17
17.470589
47
/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py
0.563694
0.503185
mrpal39/ev_code
refs/heads/master
import scrapy class WebiSpider(scrapy.Spider): name = 'webi' allowed_domains = ['web'] start_urls = ['http://web/'] def parse(self, response): pass
Python
10
16.5
32
/cte/properties/properties/spiders/webi.py
0.594286
0.594286
mrpal39/ev_code
refs/heads/master
import scrapy from scrapy.spiders import CSVFeedSpider from scrapy.spiders import SitemapSpider from scrapy.spiders import CrawlSpider,Rule from scrapy.linkextractor import LinkExtractor from tuto.items import DemoItem from scrapy.loader import ItemLoader from tuto.items import Demo class DemoSpider(CrawlSpider)...
Python
60
31.416666
71
/scrap/tuto/tuto/spiders/scrapy.py
0.637018
0.637018
mrpal39/ev_code
refs/heads/master
from oauth2_provider.views.generic import ProtectedResourceView from django.http import HttpResponse
Python
2
49.5
63
/awssam/iam/users/views.py
0.89
0.88
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: custom_filter.py Description : Author : JHao date: 2017/4/14 ------------------------------------------------- Change Activity: 2017/4/14: ----------------------------------...
Python
54
26.796297
80
/awssam/django-blog/src/blog/templatetags/custom_filter.py
0.439707
0.428381
mrpal39/ev_code
refs/heads/master
from django.db import models # Create your models here. from datetime import datetime from elasticsearch_dsl import DocType, Date, Nested, Boolean, \ analyzer, InnerObjectWrapper, Completion, Keyword, Text, Integer from elasticsearch_dsl.analysis import CustomAnalyzer as _CustomAnalyzer from elasticsearch_dsl.c...
Python
43
23.139534
72
/eswork/lcvsearch/search/models.py
0.685274
0.683349
mrpal39/ev_code
refs/heads/master
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)
Python
8
27.25
50
/Web-UI/scrapyproject/admin.py
0.808889
0.808889
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: models.py Description : Author : JHao date: 2016/11/18 ------------------------------------------------- Change Activity: 2016/11/18: --------------------------------------------...
Python
86
28.302326
101
/awssam/django-blog/src/blog/models.py
0.582937
0.565476
mrpal39/ev_code
refs/heads/master
from types import resolve_bases import scrapy from scrapy.spidermiddlewares.httperror import HttpError from twisted.internet.error import DNSLookupError from twisted.internet.error import TimeoutError,TCPTimedOutError class DemoSpider(scrapy.Spider): name='demo' start_urls=[ "http://www.httpbin.org/"...
Python
43
33.255814
76
/scrap/tuto/tuto/spiders/callable.py
0.6417
0.632254
mrpal39/ev_code
refs/heads/master
#Stage 2 Update (Python 3) 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 S...
Python
64
31.71875
107
/scrap/example_project/open_news/models.py
0.719541
0.712852
mrpal39/ev_code
refs/heads/master
from django.urls import path from .views import ( PostListView, PostDetailView, # PostCreateView, # PostUpdateView, # PostDeleteView, # UserPostListView ) from . import views from .feeds import LatestPostsFeed urlpatterns = [ path('', views.home, name='home'), path('blogs/', views.Pos...
Python
31
29.870968
73
/myapi/fullfeblog/blog/urls.py
0.623824
0.623824
mrpal39/ev_code
refs/heads/master
# coding:utf-8 import datetime from pymongo import errors from pymongo.mongo_client import MongoClient from pymongo.mongo_replica_set_client import MongoReplicaSetClient from pymongo.read_preferences import ReadPreference from scrapy.exporters import BaseItemExporter try: from urllib.parse import quote except: ...
Python
213
34.953053
144
/Web-UI/scrapyproject/scrapy_packages/mongodb/scrapy_mongodb.py
0.560721
0.55824
mrpal39/ev_code
refs/heads/master
from django.contrib.syndication.views import Feed from django.template.defaultfilters import truncatewords from django.urls import reverse_lazy from .models import Post class LatestPostsFeed(Feed): title ='My Blog' link=reverse_lazy('post_list') description = 'new post of my Blog.' def items(s...
Python
22
22.954546
56
/awssam/fullfeblog/blog/feeds.py
0.682331
0.676692
mrpal39/ev_code
refs/heads/master
import http.client conn = http.client.HTTPSConnection("bloomberg-market-and-financial-news.p.rapidapi.com") headers = { 'x-rapidapi-key': "bd689f15b2msh55122d4390ca494p17cddcjsn225c43ecc6d4", 'x-rapidapi-host': "bloomberg-market-and-financial-news.p.rapidapi.com" } conn.request("GET", "/market/get-cross-...
Python
17
34.470589
267
/awssam/tutorial/api.py
0.737542
0.682724
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: urls.py Description : Author : JHao date: 2017/4/13 ------------------------------------------------- Change Activity: 2017/4/13: -------------------------------------------...
Python
29
30.448277
66
/awssam/django-blog/src/blog/urls.py
0.486309
0.46988
mrpal39/ev_code
refs/heads/master
from scrapy.item import Item, Field import datetime import socket class PropertiesItem(Item): # Primary fields title = PropertiesItem() price = Field() description = Field() address = Field() image_urls = Field() # Calculated fields images = Field() location = Field() # House...
Python
27
21.111111
57
/scrap/properties/properties/items.py
0.642617
0.642617
mrpal39/ev_code
refs/heads/master
import scrapy from properties.items import PropertiesItem from scrapy.loader import ItemLoader from itemloaders.processors import MapCompose, Join class BasicSpider(scrapy.Spider): name = 'basic' allowed_domains = ['web'] start_urls = ['http://web:9312/properties/property_000000.html'] def parse(self,...
Python
44
46.81818
124
/cte/properties/properties/spiders/basic.py
0.574144
0.560361
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: util Description : Author : JHao date: 2020/9/30 ------------------------------------------------- Change Activity: 2020/9/30: ------------------------------------------------- ...
Python
51
20.627451
56
/awssam/django-blog/src/django_blog/util.py
0.455122
0.43971
mrpal39/ev_code
refs/heads/master
import collections from scrapy.exceptions import DropItem from scrapy.exceptions import DropItem import pymongo class TutoPipeline(object): vat=2.55 def process_item(self, item, spider): if item["price"]: if item['exclues_vat']: item['price']= item['price']*self.vat ...
Python
71
23.563381
78
/scrap/tuto/tuto/pipelines.py
0.600915
0.5992
mrpal39/ev_code
refs/heads/master
# -*- coding: utf-8 -*- BOT_NAME = 'tc_zufang' SPIDER_MODULES = ['tc_zufang.spiders'] NEWSPIDER_MODULE = 'tc_zufang.spiders' # Crawl responsibly by identifying yourself (and your website) on the user-agent #USER_AGENT = 'tc_zufang (+http://www.yourdomain.com)' #item Pipeline同时处理item的最大值为100 # CONCURRENT_ITEMS=100 #sc...
Python
61
38.19672
82
/tc_zufang/tc_zufang/tc_zufang/settings.py
0.795151
0.766304
mrpal39/ev_code
refs/heads/master
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'), ]
Python
13
23
56
/myapi/devfile/blog/urls.py
0.592949
0.592949
dspinellis/PPS-monitor
refs/heads/master
#!/usr/bin/env python3 # # Copyright 2018-2022 Diomidis Spinellis # # 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 required by app...
Python
334
33.655689
101
/ppsmon.py
0.575205
0.558445
Yuliashka/Snake-Game
refs/heads/main
from turtle import Turtle import random # we want this Food class to inherit from the Turtle class, so it will have all the capapibilities from # the turtle class, but also some specific things that we want class Food(Turtle): # creating initializer for this class def __init__(self): # we...
Python
32
36.78125
103
/food.py
0.636145
0.605622
Yuliashka/Snake-Game
refs/heads/main
from turtle import Turtle STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)] MOVE_DISTANCE = 20 UP = 90 DOWN = 270 RIGHT = 0 LEFT = 180 class Snake: # The code here is going to determine what should happen when we initialize a new snake object def __init__(self): # below we create a new...
Python
69
30.31884
118
/snake.py
0.594558
0.582516
Yuliashka/Snake-Game
refs/heads/main
from turtle import Screen import time from snake import Snake from food import Food from scoreboard import Score # SETTING UP THE SCREEN: screen = Screen() screen.setup(width=600, height=600) screen.bgcolor("black") screen.title("My Snake Game") # to turn off the screen tracer screen.tracer(0) # CREAT...
Python
94
28.74468
113
/main.py
0.636332
0.619377
Yuliashka/Snake-Game
refs/heads/main
from turtle import Turtle ALIGMENT = "center" FONT = ("Arial", 18, "normal") class Score(Turtle): def __init__(self): super().__init__() self.score = 0 self.color("white") self.penup() self.goto(0, 270) self.write(f"Current score: {self.score}", align...
Python
28
27.428572
97
/scoreboard.py
0.545783
0.528916
marcin-mulawa/Water-Sort-Puzzle-Bot
refs/heads/main
import numpy as np import cv2 import imutils picture = 'puzzle.jpg' def load_transform_img(picture): image = cv2.imread(picture) image = imutils.resize(image, height=800) org = image.copy() #cv2.imshow('orginal', image) mask = np.zeros(image.shape[:2], dtype = "uint8") cv2.rectangle(mask, (15...
Python
78
28.948717
90
/loading_phone.py
0.559503
0.494007
marcin-mulawa/Water-Sort-Puzzle-Bot
refs/heads/main
import numpy as np import cv2 import imutils picture = 'puzzle.jpg' def load_transform_img(picture): image = cv2.imread(picture) #image = imutils.resize(image, height=800) org = image.copy() #cv2.imshow('orginal', image) mask = np.zeros(image.shape[:2], dtype = "uint8") cv2.rectangle(mask, (6...
Python
88
29.897728
90
/loading_pc.py
0.5605
0.500919
marcin-mulawa/Water-Sort-Puzzle-Bot
refs/heads/main
import pyautogui as pya import solver import time import glob import os import numpy as np import cv2 import shutil path = os.getcwd() path1 = path + r'/temp' path2 = path +r'/level' try: shutil.rmtree(path1) except: pass try: os.mkdir('temp') except: pass try: os.mkdir('level') except: pass ...
Python
77
24.38961
79
/auto_puzzle.py
0.642603
0.625318
marcin-mulawa/Water-Sort-Puzzle-Bot
refs/heads/main
from collections import deque import random import copy import sys import loading_pc import os def move(new_list, from_, to): temp = new_list[from_].pop() for _i in range(0,4): if len(new_list[from_])>0 and abs(int(temp) - int(new_list[from_][-1]))<3 and len(new_list[to])<3: temp = new_li...
Python
88
24.488636
106
/solver.py
0.528546
0.514719
qtngr/HateSpeechClassifier
refs/heads/master
import warnings import os import json import pandas as pd import numpy as np import tensorflow as tf from joblib import dump, load from pathlib import Path from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression from sklearn.metrics import f1_score, classification_repo...
Python
381
32.92651
142
/classifiers.py
0.590825
0.585332
qtngr/HateSpeechClassifier
refs/heads/master
## importing packages import gc import os import random import transformers import warnings import json import numpy as np import pandas as pd import tensorflow as tf import tensorflow.keras.backend as K from pathlib import Path from sklearn.metrics import accuracy_score, classification_report from sklearn.model_sele...
Python
267
30.940075
149
/BERT_classifiers.py
0.603893
0.598734
akshayjh/spacyr
refs/heads/master
# from __future__ import unicode_literals nlp = spacy.load(lang)
Python
3
21.333334
42
/inst/python/initialize_spacyPython.py
0.701493
0.701493
PointMeAtTheDawn/warmachine-images
refs/heads/master
"""This converts a cardbundle.pdf (downloaded from Privateer Press) into Tabletop Simulator deck Saved Objects.""" import os import argparse import json import threading from shutil import copyfile import PIL.ImageOps from PIL import Image import cloudinary.uploader import cloudinary.api from pdf2image import conve...
Python
167
38.880241
97
/convert.py
0.628829
0.571471
jimrhoskins/dotconfig
refs/heads/master
import os def vcs_status(): from powerline.lib.vcs import guess repo = guess(os.path.abspath(os.getcwd())) if repo and repo.status(): return "X" else: return None
Python
9
19
44
/powerline/lib/powerext/segments.py
0.666667
0.666667
thfabian/molec
refs/heads/master
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
Python
49
25.32653
82
/python/integrators.py
0.457364
0.43876
thfabian/molec
refs/heads/master
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
Python
99
27.141415
91
/python/plot.py
0.559943
0.521536
thfabian/molec
refs/heads/master
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
Python
108
30.379629
110
/python/forces-grid.py
0.558867
0.523753
thfabian/molec
refs/heads/master
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
Python
112
30.616072
87
/python/pymolec.py
0.468512
0.459475
thfabian/molec
refs/heads/master
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
Python
63
24.15873
73
/python/periodic.py
0.51735
0.463722
anurag3301/Tanmay-Bhat-Auto-Video-Liker
refs/heads/main
from selenium import webdriver from selenium.common.exceptions import * from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from time import sleep from getpass import getpass import tkinter as tk fro...
Python
143
42.258739
158
/main.py
0.616406
0.59744
hauntshadow/CS3535
refs/heads/master
""" dir_comp.py Usage: In the functions following this, the parameters are described as follows: dir: the directory to search Program that parses all .mp3 files in the passed in directory, gets the segment arrays from each .mp3 file and puts them into a numpy array for later use. Each segment array is in the follow...
Python
161
42.770187
173
/res_mod3/dir_comp.py
0.642259
0.624663
hauntshadow/CS3535
refs/heads/master
import numpy as np def check(filename): clusters = np.load(filename) clusters = clusters[1] truths = np.load("Results/groundtruths.npy") error = 0 total = 0 for i in range(len(truths)): for j in range(len(truths[i])): if clusters[truths[i][j]] != clusters[i]: ...
Python
15
24.799999
53
/ResultCheck/CheckTruths.py
0.55814
0.54522
hauntshadow/CS3535
refs/heads/master
""" h5_seg_to_array.py Usage: In the functions following this, the parameters are described as follows: dir: the directory to search filename: the filename for saving/loading the results to/from Program that parses all .h5 files in the passed in directory and subdirectories, getting the segment arrays from each .h5...
Python
87
35.793102
91
/h5_array/h5_seg_to_array.py
0.672915
0.659169
hauntshadow/CS3535
refs/heads/master
""" timing.py Usage: In the functions following this, the parameters are described as follows: filename: the file that contains segment data This file must have been a NumPy array of segment data that was saved. It is loaded through NumPy's load function. Each segment array is in the following format: [12 values ...
Python
43
35.046513
124
/res_mod4/timing.py
0.715484
0.650323
hauntshadow/CS3535
refs/heads/master
import matplotlib matplotlib.use("Agg") import numpy as np import matplotlib.pyplot as plt import time from collections import Counter def truth_generator(filename): data = np.load(filename) data.resize(100000, 27) truths = [] for i in range(len(data)): truths.append([]) t0 = time.time() ...
Python
64
30.0625
71
/ResultCheck/GroundTruthGenerate.py
0.532696
0.480885
hauntshadow/CS3535
refs/heads/master
""" seg_kmeans.py This code performs K-Means clustering on a dataset passed in as a pickled NumPy array. There is a function (seg_kmeans) that performs K-Means on the dataset not using another class's stuff. There is another function (KMeans) that performs K-Means on the dataset by using Scikit-Learn's K-Means class...
Python
144
32.159721
106
/res_mod5/seg_kmeans.py
0.646283
0.629319
hauntshadow/CS3535
refs/heads/master
""" Self_compare_dist.py Usage: This program has a function called self_seg_compare(). This function takes a track id (named as a parameter in the function), compares every segment to every other segment, and prints out the following information: 1. The number of segments that have one or more matches 2. The ...
Python
119
43.823528
126
/res_mod2/self_compare_dist.py
0.661293
0.641237
hauntshadow/CS3535
refs/heads/master
import numpy as np from collections import Counter def calculate(filename): data = np.load(filename) checked = data[1] countClusters = Counter() counter = Counter() for i in checked: countClusters[i] += 1 for i in countClusters.values(): counter[i] += 1 val = counter.values(...
Python
21
24.952381
55
/ResultCheck/CalcTime.py
0.594495
0.557798
hauntshadow/CS3535
refs/heads/master
#!/usr/bin/env python # encoding: utf=8 """ one.py Digest only the first beat of every bar. By Ben Lacker, 2009-02-18. """ ''' one_segment.py Author: Chris Smith, 02-05-2015 Changes made to original one.py: - Changes made to take the first segment out of every beat. - Does not take the first beat from ev...
Python
64
23.84375
110
/one_segment/one_segment.py
0.665409
0.650314
HoeYeon/Basic_Cnn
refs/heads/master
# coding: utf-8 # In[1]: import numpy as np import tensorflow as tf import requests import urllib from PIL import Image import os import matplotlib.pyplot as plt get_ipython().magic('matplotlib inline') # In[ ]: #Get image from url #a = 1 #with open('Cat_image.txt','r') as f: # urls = [] # for url in f: # ...
Python
320
26.603125
99
/Train_model.py
0.633247
0.595338
HoeYeon/Basic_Cnn
refs/heads/master
# coding: utf-8 # In[2]: import numpy as np import tensorflow as tf import requests import urllib from PIL import Image import os import matplotlib.pyplot as plt import cv2 as cv2 get_ipython().magic('matplotlib inline') # In[3]: os.chdir("C:\\Users\\USER\\python studyspace\\Deep learning\\Project") pic = Image...
Python
59
15.762712
70
/Prediction.py
0.683787
0.654582
gagan1411/COVID-19
refs/heads/master
# -*- coding: utf-8 -*- """ Created on Sun May 10 23:34:29 2020 @author: HP USER """ import urllib.request, urllib.error, urllib.parse import json import sqlite3 import pandas as pd from datetime import datetime import matplotlib.pyplot as plt import matplotlib import numpy as np #retrieve json fil...
Python
131
35.198475
103
/retrieve&PlotData.py
0.629592
0.610302
jbaquerot/Python-For-Data-Science
refs/heads/master
# IPython log file import json path = 'ch02/usagov_bitly_data2012-03-16-1331923249.txt' records = [json.loads(line) for line in open(path)] import json path = 'ch2/usagov_bitly_data2012-03-16-1331923249.txt' records = [json.loads(line) for line in open(path)] import json path = 'ch2/usagov_bitly_data2012-11-13-13528...
Python
47
31.021276
66
/ipython_log.py
0.646512
0.595349
solarkyle/lottery
refs/heads/main
import random def lottery_sim(my_picks, num_tickets): ticket = 1 winners = {3:0,4:0,5:0,6:0} for i in range(num_tickets): ticket+=1 drawing = random.sample(range(1, 53), 6) correct = 0 for i in my_picks: if i in drawing: correct+=1 if corr...
Python
27
21.185184
48
/lottery.py
0.473244
0.397993
valentecaio/caiotile
refs/heads/master
#!/usr/bin/python3 import argparse import subprocess import re HEIGHT_OFFSET = 60 class Rectangle: def __init__(self, x, y, w, h): self.x = int(x) # origin x self.y = int(y) # origin y self.w = int(w) # width self.h = int(h) # height def __str__(self): return str(sel...
Python
182
26.175825
74
/caiotile.py
0.538617
0.530732
Jmitch13/Senior-Honors-Project
refs/heads/main
import requests import sqlite3 from sqlite3 import Error from bs4 import BeautifulSoup # Create the batter pool database BatterPool = sqlite3.connect('TeamBatterPool.db') positionList = ['c', '1b', '2b', 'ss', '3b', 'rf', 'cf', 'lf', 'dh'] yearList = ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '...
Python
55
52.981819
611
/TeamBatterPool.py
0.641534
0.624669
Jmitch13/Senior-Honors-Project
refs/heads/main
import requests import sqlite3 from sqlite3 import Error from bs4 import BeautifulSoup # Create the pitcher pool database PitcherPool = sqlite3.connect('TeamPitcherPool1.db') yearList = ['2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019'] teamList = ["Los_Angeles_Angels", "Baltimore_Orioles", "Bo...
Python
60
63.133335
611
/TeamPitcherPool.py
0.660696
0.610287