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
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
# -*- coding: utf-8 -*- #如果没有下一页的地址则返回none list_first_item = lambda x:x[0] if x else None --- FILE SEPARATOR --- 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_KE...
[ "/tc_zufang/tc_zufang-slave/tc_zufang/utils/result_parse.py", "/awssam/wikidj/wikidj/settings.py", "/Web-UI/mysite/views.py" ]
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
# -*- coding: utf-8 -*- res=u'\u4e30\u6cf0\u57ce' # rr=res.encode('gbk') print res --- FILE SEPARATOR --- 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(...
[ "/tc_zufang/django_web/django_web/test.py", "/scrap/tutorial/scrap/spiders/spider.py", "/awssam/iam/users/views.py" ]
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
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/"...
[ "/scrap/tuto/tuto/spiders/callable.py", "/scrap/tutorial/scrap/spiders/login.py", "/Web-UI/scrapyproject/migrations/0009_auto_20170215_0657.py" ]
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
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...
[ "/awssam/iam/iam/settings.py", "/Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py", "/scrap/tuto/tuto/spiders/callable.py" ]
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
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...
[ "/awssam/ideablog/core/models.py", "/awssam/ideablog/core/admin.py", "/Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py" ]
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
# 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...
[ "/awssam/myscrapyproject/scrapyapi/srp/models.py", "/myapi/fullfeblog/blog/templatetags/blog_tags.py", "/myapi/fullfeblog/blog/blog_tags.py" ]
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
# -*- 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...
[ "/tc_zufang/tc_zufang-slave/tc_zufang/utils/message.py", "/myapi/devfile/core/api.py", "/tc_zufang/tc_zufang-slave/tc_zufang/mongodb_pipeline.py" ]
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
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", "/eswork/lcvsearch/search/models.py", "/Web-UI/scrapyproject/views.py" ]
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
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 --- from django.apps import AppConfig class CorescrapConfig(AppConfig):...
[ "/Web-UI/scrapyproject/admin.py", "/awssam/myscrapyproject/dev/corescrap/apps.py", "/Web-UI/scrapyproject/migrations/0009_auto_20170215_0657.py" ]
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
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 --- from django.shortcuts import render from urllib.request import urlopen...
[ "/awssam/ideablog/core/admin.py", "/march19/devfile/api/views.py", "/tc_zufang/tc_zufang/tc_zufang/utils/InsertRedis.py" ]
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
# 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...
[ "/Web-UI/examples/link_generator.py", "/myapi/fullfeblog/blog/views.py", "/scrap/tutorial/scrap/spiders/SitemapSpider.py" ]
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
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...
[ "/awssam/iam/iam/settings.py", "/scrap/example_project/open_news/models.py", "/awssam/django-blog/src/django_blog/blogroll.py" ]
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
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: custom_filter.py Description : Author : JHao date: 2017/4/14 ------------------------------------------------- Change Activity: 2017/4/14: ----------------------------------...
[ "/awssam/django-blog/src/blog/templatetags/custom_filter.py", "/myapi/fullfeblog/blog/forms.py", "/tc_zufang/tc_zufang-slave/tc_zufang/spiders/testip.py" ]
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
# -*- 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", "/awssam/fullfeblog/blog/sitemaps.py", "/scrap/tutorial/scrap/spiders/reactor.py" ]
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
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): ...
[ "/scrap/tutorial/scrap/spiders/spider.py", "/eswork/lcvsearch/test.py", "/myapi/fullfeblog/blog/urls.py" ]
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
# 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", "/Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py", "/myapi/devfile/core/forms.py" ]
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
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...
[ "/myapi/devfile/core/api.py", "/Web-UI/scrapyproject/scrapy_packages/mongodb/scrapy_mongodb.py", "/tc_zufang/django_web/django_web/test.py" ]
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
from django.conf.urls import url from . import views urlpatterns = [ url('api/', views.apiurl, name='index'), ] --- FILE SEPARATOR --- # -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: util Description : Author : JHao date: 2020/9/30 -------...
[ "/march19/devfile/api/urls.py", "/awssam/django-blog/src/django_blog/util.py", "/tc_zufang/tc_zufang-slave/tc_zufang/utils/message.py" ]
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
# -*- 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", "/scrap/properties/properties/spiders/basic.py", "/awssam/tutorial/api.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', '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
# 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...
[ "/Web-UI/examples/link_generator.py", "/Web-UI/scrapyproject/admin.py", "/scrap/tutorial/scrap/spiders/SitemapSpider.py" ]
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
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...
[ "/awssam/ideablog/core/models.py", "/scrap/first_scrapy/first_scrapy/items.py", "/cte/properties/properties/spiders/basic.py" ]
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
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", "/awssam/fullfeblog/blog/feeds.py", "/eswork/lcvsearch/search/models.py" ]
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
# -*- 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", "/cte/projectfile/projectfile/items.py", "/Web-UI/scrapyproject/forms.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.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
# -*- 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...
[ "/scrap/properties/properties/pipelines.py", "/awssam/django-blog/src/blog/templatetags/custom_filter.py", "/eswork/lcvsearch/test.py" ]
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
# 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: ...
[ "/Web-UI/scrapyproject/scrapy_packages/mongodb/scrapy_mongodb.py", "/Web-UI/scrapyproject/models.py", "/eswork/articles/articles/items.py" ]
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
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 ...
[ "/awssam/fullfeblog/blog/sitemaps.py", "/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py", "/cte/properties/properties/spiders/webi.py" ]
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
# -*- 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", "/eswork/articles/articles/pipelines.py", "/myapi/fullfeblog/blog/search_indexes.py" ]
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
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", "/scrap/first_scrapy/first_scrapy/items.py", "/scrap/tutorial/scrap/spiders/login.py" ]
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
# -*- 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...
[ "/tc_zufang/tc_zufang/tc_zufang/spiders/tczufang_detail_spider.py", "/myapi/fullfeblog/blog/search_indexes.py", "/awssam/iam/iam/settings.py" ]
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
# -*- 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...
[ "/scrap/properties/properties/spiders/basic.py", "/awssam/myscrapyproject/dev/corescrap/apps.py", "/tc_zufang/tc_zufang-slave/tc_zufang/items.py" ]
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
# -*- 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...
[ "/tc_zufang/tc_zufang/tc_zufang/spiders/tczufang_detail_spider.py", "/scrap/tutorial/scrap/spiders/reactor.py", "/scrap/tutorial/scrap/spiders/login.py" ]
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
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", "/Web-UI/examples/scraper.py", "/eswork/lcvsearch/search/models.py" ]
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
"""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...
[ "/Web-UI/mysite/urls.py", "/myapi/fullfeblog/blog/views.py", "/Web-UI/scrapyproject/migrations/0005_auto_20170213_1053.py" ]
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
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 } ...
[ "/march19/devfile/api/views.py", "/eswork/lcvsearch/test.py", "/myapi/fullfeblog/blog/blog_tags.py" ]
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
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 --- import http.client conn = http.client.HTTPSConnection("bloomberg-mar...
[ "/Web-UI/scrapyproject/admin.py", "/awssam/tutorial/api.py", "/march19/devfile/api/views.py" ]
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
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...
[ "/awssam/wikidj/wikidj/dev.py", "/myapi/fullfeblog/blog/models.py", "/march19/devfile/api/urls.py" ]
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
# 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...
[ "/awssam/fullfeblog/blog/views.py", "/awssam/django-blog/src/django_blog/util.py", "/eswork/articles/articles/pipelines.py" ]
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
from django.conf.urls import url from . import views urlpatterns = [ url('api/', views.apiurl, name='index'), ] --- FILE SEPARATOR --- from django.urls import path,include from blog import views urlpatterns = [ # path('', views.index, name='base'), path('', views.list, name='list'), # path('home...
[ "/march19/devfile/api/urls.py", "/myapi/devfile/blog/urls.py", "/tc_zufang/tc_zufang-slave/tc_zufang/utils/result_parse.py" ]
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
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/django-blog/src/django_blog/blogroll.py", "/scrap/properties/properties/spiders/basic.py" ]
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
# 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...
[ "/myapi/devfile/request/api.py", "/myapi/devfile/request/api1.py", "/myapi/devfile/gitapi/views.py" ]
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
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'...
[ "/myapi/fullfeblog/webdev/urls.py", "/scrap/tuto/tuto/spiders/callable.py", "/scrap/tutorial/scrap/spiders/testing.py" ]
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
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?...
[ "/myapi/devfile/core/forms.py", "/awssam/django-blog/src/blog/admin.py", "/awssam/ideablog/core/models.py" ]
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
# -*- 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...
[ "/tc_zufang/django_web/datashow/views.py", "/myapi/devfile/request/api.py", "/awssam/ideablog/core/admin.py" ]
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
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/ideablog/core/migrations/0003_auto_20201113_0620.py", "/march19/devfile/api/views.py" ]
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
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/scrapy_packages/rabbitmq/scheduler.py", "/awssam/django-blog/src/django_blog/blogroll.py" ]
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
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'}, ...
[ "/scrap/tutorial/scrap/spiders/login.py", "/tc_zufang/tc_zufang-slave/tc_zufang/spiders/tczufang_detail_spider.py", "/myapi/devfile/core/views.py" ]
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
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...
[ "/awssam/ideablog/core/models.py", "/Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py", "/scrap/example_project/open_news/models.py" ]
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
# 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...
[ "/awssam/fullfeblog/blog/views.py", "/eswork/articles/articles/pipelines.py", "/myapi/devfile/gitapi/jp.py" ]
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
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: blogroll Description : Author : JHao date: 2020/10/9 ------------------------------------------------- Change Activity: 2020/10/9: ----------------------------------------------...
[ "/awssam/django-blog/src/django_blog/blogroll.py", "/awssam/wikidj/wikidj/codehilite.py", "/awssam/myscrapyproject/scrapyapi/srp/models.py" ]
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
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() ...
[ "/Web-UI/scrapyproject/forms.py", "/awssam/iam/users/urls.py", "/Web-UI/scrapyproject/scrapy_packages/sample_settings.py" ]
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
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...
[ "/myapi/devfile/core/views.py", "/myapi/devfile/gitapi/jp.py", "/myapi/devfile/gitapi/views.py" ]
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
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]+)/'...
[ "/Web-UI/scrapyproject/urls.py", "/myapi/fullfeblog/blog/search_indexes.py", "/scrap/properties/properties/spiders/basic.py" ]
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
# -*- 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...
[ "/Web-UI/scrapyproject/scrapy_packages/rabbitmq/connection.py", "/Web-UI/mysite/urls.py", "/awssam/ideablog/core/views.py" ]
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
# -*- 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...
[ "/eswork/articles/articles/spiders/pm_spider.py", "/tc_zufang/django_web/django_web/test.py", "/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py" ]
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
# -*- 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/django-blog/src/blog/views.py", "/scrap/tuto/tuto/spiders/callable.py" ]
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
# -*- 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...
[ "/scrap/properties/properties/spiders/basic.py", "/Web-UI/examples/scraper.py", "/awssam/django-blog/src/blog/admin.py" ]
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
import scrapy class WebiSpider(scrapy.Spider): name = 'webi' allowed_domains = ['web'] start_urls = ['http://web/'] def parse(self, response): pass --- FILE SEPARATOR --- from django.http.response import HttpResponse from requests_oauthlib import OAuth2Session import json import request...
[ "/cte/properties/properties/spiders/webi.py", "/myapi/devfile/core/api.py", "/scrap/example_project/open_news/models.py" ]
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
# -*- 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...
[ "/tc_zufang/django_web/datashow/views.py", "/awssam/wikidj/wikidj/settings.py", "/myapi/devfile/gitapi/urls.py" ]
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
# -*- 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() ...
[ "/tc_zufang/django_web/datashow/models.py", "/scrap/example_project/open_news/migrations/0002_document.py", "/scrap/tutorial/scrap/spiders/login.py" ]
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
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/migrations/0009_auto_20170215_0657.py", "/awssam/myscrapyproject/scrapyapi/srp/models.py" ]
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
# -*- 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", "/awssam/iam/users/views.py", "/eswork/lcvsearch/test.py" ]
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
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...
[ "/myapi/devfile/core/api.py", "/awssam/ideablog/core/migrations/0003_auto_20201113_0620.py", "/tc_zufang/tc_zufang-slave/tc_zufang/items.py" ]
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
# -*- 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...
[ "/tc_zufang/django_web/datashow/views.py", "/awssam/wikidj/wikidj/codehilite.py", "/awssam/django-blog/src/blog/admin.py" ]
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
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...
[ "/snake.py", "/main.py", "/scoreboard.py" ]
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
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...
[ "/main.py", "/scoreboard.py", "/food.py" ]
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
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...
[ "/food.py", "/scoreboard.py", "/snake.py" ]
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
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...
[ "/main.py", "/food.py", "/snake.py" ]
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
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...
[ "/loading_pc.py", "/auto_puzzle.py", "/solver.py" ]
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
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 ...
[ "/auto_puzzle.py", "/solver.py", "/loading_phone.py" ]
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
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...
[ "/loading_phone.py", "/loading_pc.py", "/solver.py" ]
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
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...
[ "/loading_pc.py", "/auto_puzzle.py", "/loading_phone.py" ]
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
## 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...
[ "/BERT_classifiers.py" ]
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
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...
[ "/classifiers.py" ]
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
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
[ "/python/forces-grid.py", "/python/pymolec.py", "/python/periodic.py" ]
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
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
[ "/python/pymolec.py", "/python/integrators.py", "/python/periodic.py" ]
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
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
[ "/python/periodic.py", "/python/pymolec.py", "/python/integrators.py" ]
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
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
[ "/python/periodic.py", "/python/forces-grid.py", "/python/integrators.py" ]
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
#!usr/bin/env python3 # _ # _ __ ___ ___ | | ___ ___ # | '_ ` _ \ / _ \| |/ _ \/ __| # | | | | | | (_) | | __/ (__ # |_| |_| |_|\___/|_|\___|\___| - Molecular Dynamics Framework # # Copyright (C) 2016 Carlo Del Don (deldonc@student.ethz.ch) # Michel Breyer (mbreyer@st...
[ "/python/pymolec.py", "/python/plot.py", "/python/integrators.py" ]
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
""" 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...
[ "/res_mod5/seg_kmeans.py", "/ResultCheck/GroundTruthGenerate.py", "/ResultCheck/CalcTime.py" ]
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
""" 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 ...
[ "/res_mod2/self_compare_dist.py", "/res_mod5/seg_kmeans.py", "/res_mod4/timing.py" ]
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
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(...
[ "/ResultCheck/CalcTime.py", "/ResultCheck/GroundTruthGenerate.py", "/res_mod2/self_compare_dist.py" ]
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
""" 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 ...
[ "/res_mod2/self_compare_dist.py", "/ResultCheck/GroundTruthGenerate.py", "/one_segment/one_segment.py" ]
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
""" 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...
[ "/h5_array/h5_seg_to_array.py", "/ResultCheck/CalcTime.py", "/res_mod5/seg_kmeans.py" ]
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
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]: ...
[ "/ResultCheck/CheckTruths.py", "/ResultCheck/GroundTruthGenerate.py", "/res_mod3/dir_comp.py" ]
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
""" 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...
[ "/res_mod3/dir_comp.py", "/ResultCheck/CheckTruths.py", "/h5_array/h5_seg_to_array.py" ]
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
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]: ...
[ "/ResultCheck/CheckTruths.py", "/res_mod4/timing.py", "/res_mod2/self_compare_dist.py" ]
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
""" 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...
[ "/h5_array/h5_seg_to_array.py", "/res_mod2/self_compare_dist.py", "/res_mod4/timing.py" ]
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
# 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...
[ "/Prediction.py" ]
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
# 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: # ...
[ "/Train_model.py" ]
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
import requests import sqlite3 from sqlite3 import Error from bs4 import BeautifulSoup # Create the free agency database International = sqlite3.connect('InternationalProspects.db') # List for the Free Agency Pool yearList = ['2015', '2016', '2017', '2018', '2019'] #Create the International Table from 2...
[ "/InternationalProspects.py", "/PlayerDraftProspects.py", "/FreeAgent.py" ]
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
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', '...
[ "/TeamBatterPool.py", "/Top100prospects.py", "/PlayerDraftProspects.py" ]