index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
39,066 | myzhongguo/OpenSaaSAPI | refs/heads/master | /dataservice/views.py | # coding: utf-8
from django.shortcuts import render
from django.http import HttpResponse
import json
import urllib
from jhddgapi.settings import DEBUG
from DevUsers import DevUsers
from IPList import IPAccess
# Create your views here.
def getDevUsers(request, params):
# ['dl', 'ac23']
try:
if requ... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,067 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasjob/views.py | # -*- coding: utf-8 -*-
import json
import urllib
from django.shortcuts import render
from django.http import HttpResponse
from SchedulerManager import SchedulerManager
# Create your views here.
global sched
sched = SchedulerManager()
# 添加 Job 任务
def addJobs(request, params):
'''
:demo params: [{"cmd": "... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,068 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasapi_clickhouse/ClickHouseClient/__init__.py | # -*- coding: utf-8 -*-
from os import path, sys
import os
configPath = os.sep.join([path.dirname(path.abspath(__file__)), "conf.ini"])
sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,069 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasapi_clickhouse/RoundAireLine.py | # -*- coding: utf-8 -*-
import __init__
# import time
from os import sys, path
import json
from collections import OrderedDict
from ClickHouseClient.ClickHouseClient import ClickHouseClient
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(le... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,070 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasjob/JobCmd_dev.py | # -*- coding: utf-8 -*-
import os
import sys
import time
reload(sys)
sys.setdefaultencoding("utf-8")
class JobCmd(object):
def __init__(self, cmd = None, job_id = None):
self.cmd = cmd
self.job_id = job_id
self.create_stamp = time.time()
def run(self, *args, **kwargs):
try:
... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,071 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasapi_clickhouse/RoundFlightInterval.py | # -*- coding: utf-8 -*-
import __init__
# import time
from os import sys, path
import json
from collections import OrderedDict
from ClickHouseClient.ClickHouseClient import ClickHouseClient
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(le... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,072 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasapi/DBClient/MysqlClient.py | #coding=utf-8
from __init__ import configPath
import MySQLdb
import ConfigParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
class MysqlClient(object):
cf = ConfigParser.ConfigParser()
cf.read(configPath)
mysql_host = cf.get("mysqldb", "mysql_host")
mysql_port = cf.getint("mysqldb", "mysql_... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,073 | myzhongguo/OpenSaaSAPI | refs/heads/master | /dataservice/DBClient/__init__.py | # no other package
from os import path
import os
configPath = os.sep.join([path.dirname(path.abspath(__file__)), "Config.ini"])
| {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,074 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasapi_clickhouse/AirType.py | # -*- coding: utf-8 -*-
import __init__
# import time
from os import sys, path
import json
from collections import OrderedDict
from ClickHouseClient.ClickHouseClient import ClickHouseClient
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(le... | {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,075 | myzhongguo/OpenSaaSAPI | refs/heads/master | /saasjob/apps.py | from __future__ import unicode_literals
from django.apps import AppConfig
class SaastaskConfig(AppConfig):
name = 'saastask'
| {"/saasapi/views.py": ["/saasapi_clickhouse/RoundFlightInterval.py", "/saasapi_clickhouse/RoundAireLine.py", "/saasapi_clickhouse/Funnel.py", "/saasapi_clickhouse/EventRemain.py", "/saasapi_clickhouse/CrossEvent.py", "/saasapi_clickhouse/EventSummary.py"], "/saasapi_clickhouse/views.py": ["/saasapi_clickhouse/Funnel.py... |
39,076 | ainusers/scrapy_boss_job | refs/heads/master | /scrapy_boss_job/spiders/job.py | # -*- coding: utf-8 -*-
import requests
import scrapy
import time
from bs4 import BeautifulSoup
from scrapy_boss_job.items import ScrapyBossJobItem
class JobSpider(scrapy.Spider):
name = 'job'
allowed_domains = ['zhipin.com']
start_urls = ['https://www.zhipin.com/job_detail/?query=%E6%B5%8B%E8%AF%95&scity=... | {"/scrapy_boss_job/spiders/job.py": ["/scrapy_boss_job/items.py"]} |
39,077 | ainusers/scrapy_boss_job | refs/heads/master | /scrapy_boss_job/main.py | from scrapy import cmdline
# 运行scrapy crawl douban_spider
# cmdline.execute('scrapy crawl job'.split())
# 文件导出csv
cmdline.execute('scrapy crawl job -o job.csv'.split())
| {"/scrapy_boss_job/spiders/job.py": ["/scrapy_boss_job/items.py"]} |
39,078 | ainusers/scrapy_boss_job | refs/heads/master | /scrapy_boss_job/items.py | # -*- 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
class ScrapyBossJobItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
# 定义要抓取的内容
position = scrapy... | {"/scrapy_boss_job/spiders/job.py": ["/scrapy_boss_job/items.py"]} |
39,079 | adithyan-777/localmusic-api | refs/heads/master | /main.py | from flask import Flask, json
from dbus.mainloop.glib import DBusGMainLoop
from mpris2 import get_players_uri, Player
import config
DBusGMainLoop(set_as_default=True)
playing_state = {}
api = Flask(__name__)
# Route for Ping endpoint
@api.route('/ping', methods=['GET'])
def get_ping():
return "Pong"
# Route ... | {"/main.py": ["/config.py"]} |
39,080 | adithyan-777/localmusic-api | refs/heads/master | /config.py | IGNORE_CHROME_MPRIS = True
DEBUG = True
| {"/main.py": ["/config.py"]} |
39,081 | projetosparalelos/hl7v2_django | refs/heads/master | /hl7_dispatch_config.py |
"""
We need to be able to dispatch based on the message type,
and the destination application.
MSH.9/MSH.5/MSH.6
2.16.9.2 MSH-2 Encoding characters (ST) 00002
2.16.9.3 MSH-3 Sending application (HD) 00003
2.16.9.4 MSH-4 Sending facility (HD) 00004
2.16.9.5 MSH-5 Receiving applicati... | {"/hl7_dispatch_config.py": ["/hl7v2_django/dispatch.py"], "/hl7v2_django/management/commands/runmllpyserver.py": ["/hl7v2_django/dispatch.py"]} |
39,082 | projetosparalelos/hl7v2_django | refs/heads/master | /hl7v2_django/dispatch.py | """
This is the hl7v2 dispatch mechanism. The purpose is to locate a function
which is responsible for processing a request.
"""
import re
from django.conf import settings
from django.core.urlresolvers import get_callable
from django.utils.importlib import import_module
from django.db import transaction
fro... | {"/hl7_dispatch_config.py": ["/hl7v2_django/dispatch.py"], "/hl7v2_django/management/commands/runmllpyserver.py": ["/hl7v2_django/dispatch.py"]} |
39,083 | projetosparalelos/hl7v2_django | refs/heads/master | /hl7v2_django/management/commands/runmllpyserver.py | """
The MLLP protocol is very simple. A process sends bytes to another
process, Bytes are wrapped in a frame using frame characters.
The content of the frame is limited to printable ascii characters
and the carriage return.
"""
import socket
import select
import logging
from optparse import make_... | {"/hl7_dispatch_config.py": ["/hl7v2_django/dispatch.py"], "/hl7v2_django/management/commands/runmllpyserver.py": ["/hl7v2_django/dispatch.py"]} |
39,084 | projetosparalelos/hl7v2_django | refs/heads/master | /hl7v2_django/responses.py | """
responses.py
mechanism to create a response from a request message. There are
three response types, ACK, NAK and a valid response.
There are many weaknesses in this code. At the moment, the separator
structure is fixed. Encoding and separators should be taken from the
request.
"""
import ... | {"/hl7_dispatch_config.py": ["/hl7v2_django/dispatch.py"], "/hl7v2_django/management/commands/runmllpyserver.py": ["/hl7v2_django/dispatch.py"]} |
39,085 | projetosparalelos/hl7v2_django | refs/heads/master | /sd/mfn_handlers.py | """
Master File Notification messages (Chapter 8)
"""
from hl7v2_django import responses
def m02(request, *args, **kwargs): # practitioner
import pdb; pdb.set_trace()
resp = responses.hl7ACK(request, 'AA')
return resp
def m05(request, *args, **kwargs): # location
import pdb; pdb.set_trace()
... | {"/hl7_dispatch_config.py": ["/hl7v2_django/dispatch.py"], "/hl7v2_django/management/commands/runmllpyserver.py": ["/hl7v2_django/dispatch.py"]} |
39,094 | krainet/Wordplease | refs/heads/master | /blogs/api.py | # -*- coding: utf-8 -*-
from posts.permissions import PostPermission
__author__ = 'hadock'
from blogs.serializers import BlogSerializer, BlogListSerializer
from blogs.views import BlogQuerySet
from rest_framework.viewsets import ModelViewSet
from blogs.models import Blog
from rest_framework.permissions import IsAuthen... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,095 | krainet/Wordplease | refs/heads/master | /posts/forms.py | # -*- coding: utf-8 -*-
from blogs.models import Blog
__author__ = 'hadock'
from django import forms
from posts.models import Post
class PostCreateForm(forms.ModelForm):
class Meta:
model = Post
exclude = ['owner', 'status', 'blog']
# TODO Conseguir que el form solo muestre los blogs del us... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,096 | krainet/Wordplease | refs/heads/master | /wordplease/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from users import urls as user_urls
from blogs import urls as blog_urls
from posts import urls as post_urls
from users import api_urls as user_api_urls
from blogs import api_urls as blog_api_urls
from posts import api_url... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,097 | krainet/Wordplease | refs/heads/master | /posts/urls.py | # -*- coding: utf-8 -*-
from posts.views import PostCreateView, PostsUserViewAll
from posts.views import PostsUserView, PostsDetailView
from django.conf.urls import url
urlpatterns = [
url(r'posts/$', PostsUserViewAll.as_view(), name='user_posts_single'),
url(r'posts/(?P<username>[-\w]+)/$', PostsUserView.as_... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,098 | krainet/Wordplease | refs/heads/master | /blogs/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
PENDING = u'PEND'
PUBLISHED = u'PUB'
DELETED = u'DEL'
ACTIVE = u'ACT'
DISABLED = u'DIS'
BLOG_STATUS = (
(ACTIVE, u'Activated'),
(DISABLED, u'Disabled')
)
class Blog(models.Model):
... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,099 | krainet/Wordplease | refs/heads/master | /posts/serializers.py | # -*- coding: utf-8 -*-
from posts.models import Post
from django.core.urlresolvers import reverse
__author__ = 'hadock'
from rest_framework import serializers
class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
read_only_fields = ('owner', 'status', 'blog')
class PostLis... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,100 | krainet/Wordplease | refs/heads/master | /blogs/views.py | # -*- coding: utf-8 -*-
from blogs.models import PUBLISHED, Blog, ACTIVE
from posts.models import Post, PUBLIC
from django.shortcuts import render
from django.views.generic import View
from django.db.models import Q
class HomeView(View):
def get(self, req):
posts = Post.objects.filter(status=PUBLISHED, po... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,101 | krainet/Wordplease | refs/heads/master | /users/forms.py | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
__author__ = 'hadock'
from django import forms
class LoginForm(forms.Form):
usr = forms.CharField(label='Username')
pwd = forms.CharField(label='Password', widget=forms.PasswordInput)
class UserCreateForm(forms.ModelForm):
class Meta:
... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,102 | krainet/Wordplease | refs/heads/master | /posts/api.py | # -*- coding: utf-8 -*-
from blogs.models import Blog
from posts.permissions import PostPermission
__author__ = 'hadock'
from posts.serializers import PostListSerializer, PostSerializer
from posts.views import PostQuerySet
from rest_framework.viewsets import ModelViewSet
from posts.models import Post, PUBLISHED
class... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,103 | krainet/Wordplease | refs/heads/master | /posts/permissions.py | # -*- coding: utf-8 -*-
__author__ = 'hadock'
from rest_framework.permissions import BasePermission
class PostPermission(BasePermission):
def has_permission(self, request, view):
if request.user.is_superuser:
return True
elif view.action in ['retrieve', 'destroy', 'list']:
... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,104 | krainet/Wordplease | refs/heads/master | /blogs/admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin
from blogs.models import Blog
# Register your models here.
class BlogAdmin(admin.ModelAdmin):
list_display = ('owner', 'title', 'status')
list_filter = ('owner', 'status')
search_fields = ('title',)
def owner_name(self, obj):
return ob... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,105 | krainet/Wordplease | refs/heads/master | /blogs/permissions.py | # -*- coding: utf-8 -*-
__author__ = 'hadock'
from rest_framework.permissions import BasePermission
class BlogPermission(BasePermission):
def has_permission(self, request, view):
if request.user.is_superuser:
return True
elif view.action in ['destroy']:
return False
... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,106 | krainet/Wordplease | refs/heads/master | /users/api.py | # -*- coding: utf-8 -*-
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet, GenericViewSet
from users.permissions import UserPermission
__author__ = 'hadock'
from django.contrib.auth.models import User
from users.serialize... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,107 | krainet/Wordplease | refs/heads/master | /blogs/forms.py | # -*- coding: utf-8 -*-
__author__ = 'hadock'
from django import forms
from blogs.models import Blog
class BlogCreateForm(forms.ModelForm):
class Meta:
model = Blog
exclude = ['owner']
| {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,108 | krainet/Wordplease | refs/heads/master | /blogs/urls.py | # -*- coding: utf-8 -*-
from blogs.views import HomeView, BlogListView, BlogUserView, BlogByIdView
from django.conf.urls import url
urlpatterns = [
url(r'^$', HomeView.as_view(), name='blogs_home'),
url(r'^blogs$', BlogListView.as_view(), name='blogs_list'),
url(r'blogs/(?P<username>[-\w]+)/$', BlogUserVi... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,109 | krainet/Wordplease | refs/heads/master | /users/permissions.py | # -*- coding: utf-8 -*-
__author__ = 'hadock'
from rest_framework.permissions import BasePermission
class UserPermission(BasePermission):
def has_permission(self, request, view):
"""
Define si el user autenticado en request.user tiene permiso para realizar una accion
ya sea (get , post , p... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,110 | krainet/Wordplease | refs/heads/master | /users/api_urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from users.api import UserViewSet
router = DefaultRouter()
router.register('user', UserViewSet, base_name='user')
urlpatterns = [
url(r'1.0/', include(router.urls)), # include de las url's router
]
| {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,111 | krainet/Wordplease | refs/heads/master | /blogs/api_urls.py | # -*- coding: utf-8 -*-
from blogs.api import BlogViewSet
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('blog', BlogViewSet)
urlpatterns = [
url(r'1.0/', include(router.urls)), # include de las url's router
]
| {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,112 | krainet/Wordplease | refs/heads/master | /posts/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('blogs', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,113 | krainet/Wordplease | refs/heads/master | /posts/models.py | # -*- coding: utf-8 -*-
from blogs.models import Blog
from django.db import models
from django.contrib.auth.models import User
PENDING = u'PEND'
PUBLISHED = u'PUB'
DELETED = u'DEL'
ACTIVE = u'ACT'
DISABLED = u'DIS'
PUBLIC = u'PUB'
PRIVATE = u'PRIV'
POST_STATUS = (
(PENDING, 'Pendiente Moderacion'),
(PUBLISHE... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,114 | krainet/Wordplease | refs/heads/master | /users/views.py | # -*- coding: utf-8 -*-
import logging
from blogs.models import Blog
from django.contrib.auth import logout as django_logout, authenticate, login as django_login
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from users.forms import LoginForm, UserCreateForm
from django.views.... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,115 | krainet/Wordplease | refs/heads/master | /users/serializers.py | # -*- coding: utf-8 -*-
from blogs.models import Blog
from django.contrib.auth.models import User
from wordplease.settings import PH_IMAGES
__author__ = 'hadock'
from rest_framework import serializers
class UserSerializer(serializers.Serializer):
# parecido a un form
id = serializers.ReadOnlyField() # campo... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,116 | krainet/Wordplease | refs/heads/master | /posts/api_urls.py | # -*- coding: utf-8 -*-
from posts.api import PostViewSet
from django.conf.urls import include, url
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('post', PostViewSet)
urlpatterns = [
url(r'1.0/', include(router.urls)),
]
| {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,117 | krainet/Wordplease | refs/heads/master | /blogs/serializers.py | # -*- coding: utf-8 -*-
from blogs.models import Blog
from django.core.urlresolvers import reverse
__author__ = 'hadock'
from rest_framework import serializers
class BlogSerializer(serializers.ModelSerializer):
my_blog_url = serializers.SerializerMethodField('get_blog_url')
class Meta:
model = Blog... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,118 | krainet/Wordplease | refs/heads/master | /posts/views.py | # -*- coding: utf-8 -*-
from blogs.models import Blog
from posts.forms import PostCreateForm
from posts.models import Post, PUBLISHED, PUBLIC
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic impor... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,119 | krainet/Wordplease | refs/heads/master | /users/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import url
from users.views import LoginView, LogoutView, SignupView
urlpatterns = [
url(r'^login$', LoginView.as_view(), name='users_login'),
url(r'^logout$', LogoutView.as_view(), name='users_logout'),
url(r'^signup$', SignupView.as_view(), name='users_signup... | {"/blogs/api.py": ["/posts/permissions.py", "/blogs/serializers.py", "/blogs/views.py", "/blogs/models.py"], "/posts/forms.py": ["/blogs/models.py", "/posts/models.py"], "/posts/urls.py": ["/posts/views.py"], "/posts/serializers.py": ["/posts/models.py"], "/blogs/views.py": ["/blogs/models.py", "/posts/models.py"], "/p... |
39,212 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/split_bubble.py | import numpy as np
import cv2
def split_bubble(captcha):
""" Performs character segmentation in a CAPTCHA of type 'bubble' or 'bubble_cut'
:param captcha: thresholded 'dotted' captcha as a 90x200 numpy.ndarray
:return: a list of 6 numpy.ndarray objects
"""
thresh = cv2.copyMakeBorder(captcha.c... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,213 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/__init__.py |
from .scraping import *
from .load_labels import *
from .clipboard import copy_image_to_clipboard
from .clipboard import load_image_from_clipboard
from .segmentation import *
from .prediction import *
from .LogFile import LogFile
from .break_captcha import *
from .save_auction_summary import *
from .search_auction ... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,214 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/check_consec_errors.py | from typing import List
def check_consec_errors(int_list: List[int], n: int) -> bool:
if len(int_list) < n:
return(False)
else:
if int_list[-1] == (int_list[-n] + (n - 1)):
return(True)
else:
return(False) | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,215 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/search_auction.py | def search_auction(browser, co_uasg, num_preg):
""" Insert search parameters and navigates to CAPTCHA page
:param browser: a Selenium webdriver instance
:param co_uasg: a 6-digit search parameter
:param num_preg: a 10-digit search parameter
"""
browser.get('http://comprasnet.gov.br/livre/pr... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,216 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /scrape_records.py | import time
import pandas as pd
from glob import glob
from selenium import webdriver
from keras.models import load_model
import comprasnet_captcha_breaker as ccb
OUTPUT_FOLDER = 'atas'
SUPPLEMENTARY_OUTPUT_FOLDER = 'atas_comp'
SCRAPE_SUPPLEMENTARY_RECORDS = True
# Loading models
model_filenames = sorted(glob('models/... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,217 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/clipboard.py | import io
import os
from tkinter import Tk
from PIL import Image
def copy_image_to_clipboard(sleep_between_keystrokes=(0.2, 0.1, 0.1, 0.7)):
"""Copies the image of a web page using the context menu
Notes:
1) The context menu must be opened before the function is called;
2) The command sim... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,218 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/click_see_next_entry.py | def click_see_next_entry(browser):
""" Clicks on the button to access the next page of supplementary records
:param browser: a Selenium webdriver instance
"""
xpath = \
"//body/table[2]/tbody[1]/tr[1]/td[2]/*[contains(text(), 'Ver Ata Posterior')]"
browser.find_elements_by_xpath(x... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,219 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /setup.py | from setuptools import setup
# Create proper setup to be used by pip
setup(name='comprasnet_captcha_breaker',
version='0.0.1',
description='Solve Comprasnet CAPTCHAs.',
author='Andre Luis Menegatti',
packages=['comprasnet_package_breaker']) | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,220 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/LogFile.py | import pandas as pd
import os
class LogFile():
"""
Class for keeping web scraping logs and saving them to disk.
"""
def __init__(self, file: str,
create_if_not_found=True,
zero_if_empty=False):
"""
:param file: path of csv file
... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,221 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/segmentation.py | from comprasnet_captcha_breaker.split_dotted import split_dotted
from comprasnet_captcha_breaker.split_bubble import split_bubble
from comprasnet_captcha_breaker.split_wave import split_wave
def split_captcha(captcha, captcha_class):
""" Splits CAPTCHA into a different array for each character
Wrapper aro... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,222 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/scraping.py | from io import BytesIO
import requests as rq
from PIL import Image
import time
def scrape_captchas(save_path: str, n: int, url_source='default'):
""" Download multiple CAPTCHAs as png files
Note: if 'url_source' is not provided, the following will be used:
"http://comprasnet.gov.br/scripts/srf/in... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,223 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/split_dotted.py | import numpy as np
import math as mt
def split_dotted(captcha):
""" Performs character segmentation in a 'dotted' CAPTCHA
Wrapper around two more specific functions:
1) split_dotted_f: for 'dotted' captchas starting with lower case 'f';
2) split_dotted_general: every other 'dotted' captcha... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,224 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/load_labels.py | import pickle
def load_labels(label_filename):
""" Loads pickled LabelBinarizer object
:param label_filename: path of a .dat file
return: a LabelBinarizer object
"""
with open(label_filename, 'rb') as f:
lb = pickle.load(f)
return(lb) | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,225 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/resize_to_fit.py | import math as mt
import cv2
def resize_to_fit(image, width: int, height: int):
""" Adds black padding to an image so it matches a required shape
:param image: thresholded image as a numpy.ndarray
:param width: required width (not be lower than initial width)
:param height: required height (not lo... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,226 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/check_for_supplementary_records.py | import re
def check_for_supplementary_records(html_source: str):
"""Check if a given auction has supplementary records
:param html_source: html source of main procurement records
:return: a match object or None
"""
xpath = '<td align="left"> Este pregão possui (\d)+.*Ata(s)? Complementar(es)?<... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,227 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/save_auction_summary.py | def save_auction_summary(html_source: str, output_folder: str, auction_id: str, num_doc=0):
""" Saves html source of an auction summary in disk
:param html_source: html source of the page to be saved
:param output_folder: directory where the file will be saved
:param auction_id: string with the 16-... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,228 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/break_captcha.py | import time
import numpy as np
import cv2
from selenium import webdriver
from comprasnet_captcha_breaker.clipboard import copy_image_to_clipboard, load_image_from_clipboard
from comprasnet_captcha_breaker.prediction import predict_captcha_type, predict_letters
def solve_and_submit(browser, model_list, labels_list):
... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,229 | ken2190/comprasnet_captcha_breaker | refs/heads/master | /comprasnet_captcha_breaker/prediction.py | import numpy as np
from comprasnet_captcha_breaker.resize_to_fit import resize_to_fit
from comprasnet_captcha_breaker.segmentation import split_captcha
def predict_captcha_type(captcha, model, labels):
""" Predicts CAPTCHA type using a CNN
Identified types: bubble, bubble_cut, dotted, dotted_wave, wave
... | {"/comprasnet_captcha_breaker/__init__.py": ["/comprasnet_captcha_breaker/scraping.py", "/comprasnet_captcha_breaker/load_labels.py", "/comprasnet_captcha_breaker/clipboard.py", "/comprasnet_captcha_breaker/segmentation.py", "/comprasnet_captcha_breaker/prediction.py", "/comprasnet_captcha_breaker/LogFile.py", "/compra... |
39,231 | speedrunner911/vbk-grpc-python-examples | refs/heads/master | /veriblock_pb2_grpc.py | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import veriblock_pb2 as veriblock__pb2
class AdminStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
... | {"/expamples.py": ["/veriblock_pb2_grpc.py"]} |
39,232 | speedrunner911/vbk-grpc-python-examples | refs/heads/master | /expamples.py |
import grpc
import binascii
import veriblock_pb2
import veriblock_pb2_grpc
import base64
import base58
channel = grpc.insecure_channel('localhost:10502')
client = veriblock_pb2_grpc.AdminStub(channel)
# utils
def convertAtomicToVbkUnits(input):
return input/100000000
def convertAddressToByteString(address):
... | {"/expamples.py": ["/veriblock_pb2_grpc.py"]} |
39,240 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^new/$', views.new, name='new'),
url(r'^$', views.welcome, name='welcome'),
url(r'^login$', views.login, name='login'),
url(r'^register$', views.register, name='register'),
url(r'^Dashboard/(?P<fid>[0-9]+)$', views.dashboard, name='dash... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,241 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/admin.py | from django.contrib import admin
from .models import *
admin.site.register(Farmer)
admin.site.register(Farmerlogin)
admin.site.register(Weather_Station)
admin.site.register(Climate)
admin.site.register(Plant)
admin.site.register(Soil_Moisture)
admin.site.register(Water_Body)
admin.site.register(Water_Level)
admin... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,242 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0021_auto_20171119_1242.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-19 07:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0020_auto_20171104_0228'),
]
operations = [
migrations.RemoveField... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,243 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0014_auto_20171102_2021.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-02 14:51
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('plant', '0013_auto_20171102_0229'),
]
... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,244 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-05 13:01
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,245 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0015_auto_20171103_2323.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-03 17:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0014_auto_20171102_2021'),
]
operations = [
migrations.RemoveField... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,246 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/models.py | from django.db import models
from datetime import datetime
class Weather_Station(models.Model):
name = models.CharField(max_length=250)
ws_id = models.IntegerField(default=0)
longitude = models.FloatField(default=0)
latitude = models.FloatField(default=0)
def __str__(self):
return str(self.ws_id) + ' - ' + str... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,247 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0016_auto_20171103_2328.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-03 17:58
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0015_auto_20171103_2323'),
]
operations = [
migrat... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,248 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0019_auto_20171104_0226.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-03 20:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('plant', '0018_auto_20171104_0025'),
]
operations =... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,249 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/views.py | from django.http import HttpResponse
from . models import *
import json
from django.http import StreamingHttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone
from django.template import loader
def welcome(request):
template = loader.get_template('plant/welcome.html')
co... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,250 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0004_auto_20171005_2252.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-05 17:22
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0003_auto_20171005_2229'),
]
operations = [
migrat... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,251 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0017_auto_20171104_0022.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-03 18:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0016_auto_20171103_2328'),
]
operations = [
migrations.AlterField(... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,252 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0002_auto_20171005_2215.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-05 16:45
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('plant', '0001_initial'),
]
operati... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,253 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0010_auto_20171023_1632.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-23 11:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0009_actuator_status_onoff'),
]
operations = [
migrations.AlterFie... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,254 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0003_auto_20171005_2229.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-05 16:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0002_auto_20171005_2215'),
]
operations = [
migrations.AlterField(... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,255 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0020_auto_20171104_0228.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-03 20:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0019_auto_20171104_0226'),
]
operations = [
migrations.AlterField(... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,256 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0018_auto_20171104_0025.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-03 18:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0017_auto_20171104_0022'),
]
operations = [
migrations.AlterField(... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,257 | SowmyaVasuki/PlantMonitoring | refs/heads/master | /demo/plant/migrations/0023_actuator_pump_id.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-21 20:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plant', '0022_farmer_farmerid'),
]
operations = [
migrations.AddField(
... | {"/demo/plant/admin.py": ["/demo/plant/models.py"], "/demo/plant/views.py": ["/demo/plant/models.py"]} |
39,267 | JhansiSai/Pythontrng | refs/heads/master | /function_program.py | print("hello")
def add(n1,n2):
return n1+n2
n1=int(input("enter first number"))
n2=int(input("enter second number"))
print(add(n1,n2))
def fun(n):
r=0
if n>0:
r=n+fun(n-1)
return r
print(fun(5)) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,268 | JhansiSai/Pythontrng | refs/heads/master | /lambda_fun.py | f=lambda a,b:a+b
print(f(2,4))
def fun(n):
return lambda x:x+n
f=fun(2)
print(f(0))
print(f(1)) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,269 | JhansiSai/Pythontrng | refs/heads/master | /list_of_listas_input.py | l=[]
n=int(input("enter number of elements"))
for i in range(0,n):
ele=[input(),int(input())]
l.append(ele)
print(l) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,270 | JhansiSai/Pythontrng | refs/heads/master | /module_program.py | import fun_default_value as f
f.fun1('1','2','3')
| {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,271 | JhansiSai/Pythontrng | refs/heads/master | /compare_numbers.py | a=int(input("enter first number"))
b=int(input("enter second number"))
c=int(input("enter third number"))
if(a>b and a>c):
print("a is big number")
elif(b>c):
print("b is big number")
else:
print("c is big number") | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,272 | JhansiSai/Pythontrng | refs/heads/master | /operators.py | height=6.0
weight: float=60.0
print(height,weight)
cal=height/weight**weight
print(cal)
s='cnej'
k='cjsdnc'
print(s+k)
print(height+weight)
print(height,weight)
x=int(input("enter a number"))
if(x==0):
print("x is zero")
elif(x==1):
print("x is one")
elif(x==2):
print("x is two")
else:
print("x is grea... | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,273 | JhansiSai/Pythontrng | refs/heads/master | /list_with_exception.py | try:
l=[]
while True:
l.append(int(input()))
except:
print(l) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,274 | JhansiSai/Pythontrng | refs/heads/master | /break_program.py | i = 10
j = 20
for i in range(10, 15):
print(i)
break
for i in range(5,15):
if i==12:
print(i)
continue
print(i)
for k in range(1,10):
pass
print("hello")
| {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,275 | JhansiSai/Pythontrng | refs/heads/master | /paper_ceaser_game.py | from package_program import hello as h
h.hel()
def fun(n1,n2):
if n1==n2:
print("both won")
elif(n1>n2):
print("first player won")
else:
print("second player won")
play_again=input("play again?(y/n)")
if play_again=='y':
n1 = int(input("enter a choice of player1:"))
... | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,276 | JhansiSai/Pythontrng | refs/heads/master | /prime_numbers.py | n=int(input("enter a number:"))
for i in range(2,n+1):
c=0
for j in range(1,i+1):
if i%j==0:
c=c+1
if c==2:
print(i) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,277 | JhansiSai/Pythontrng | refs/heads/master | /birthday_program.py | list={"jhansi":"29/05/00",
"john":"23/1/22",
"sai":"12/3/12"
}
def birth(n):
if n=="jhansi":
print(n+" birthday date is "+list["jhansi"])
elif n=="john":
print(n + " birthday date is " + list["john"])
else:
print(n + " birthday date is " + list["sai"])
k=input("enter y/n"... | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,278 | JhansiSai/Pythontrng | refs/heads/master | /man_age.py | n=int(input("enter the age"))
s=str(input("enter the name"))
print(s+" left with ")
#print("left with ")
print(100-n) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,279 | JhansiSai/Pythontrng | refs/heads/master | /package_program/__init__.py | import paper_ceaser_game as p
p.fun(2,1) | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,280 | JhansiSai/Pythontrng | refs/heads/master | /time_sheet.py | class Time_sheet:
def __init__(self,date,hours,activity,status):
self.dates=date
self.hours=hours
self.activity=activity
self.status=status
def timesheet(self):
print("this is the my first time sheet")
def display(self):
print(self.dates,self.hours,self.activi... | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,281 | JhansiSai/Pythontrng | refs/heads/master | /fun_default_value.py | def fun(fname, lname="hello"):
print(fname + " " + lname)
fun("emil")
fun("jhansi")
fun("sai")
def fun1(*kid):
print("the young children" + kid[1])
print(kid)
fun1("emil", "jhansi", "sai")
def fun2(ch1, ch2, ch3):
print(ch2)
fun2(ch1="emil", ch2="jhansi", ch3="sai")
def fun3(**kid):
print(... | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
39,282 | JhansiSai/Pythontrng | refs/heads/master | /list_program.py | l=[1,2,3,4,5]
print(l)
for a in l:
print(a)
print(type(a))
print(l)
for v in range(-10,-100,-30):
print(v)
words=['cat','dog','monkey']
for w in words:
print(w,len(w))
if len(w) > 5:
words.insert(0,w)
print(words)
lst=[]
n=int(input("enter number of elements:"))
for i in range(0,n):
ele=int(inp... | {"/module_program.py": ["/fun_default_value.py"], "/paper_ceaser_game.py": ["/package_program/__init__.py"], "/package_program/__init__.py": ["/paper_ceaser_game.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.