index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
44,825 | elektrodx/omcor-beta-v01 | refs/heads/master | /omcor/order/migrations/0002_orderdetail_item.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-05 23:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('items', '0001_initial'),
('order', '0001_initial'),
... | {"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]} |
44,826 | elektrodx/omcor-beta-v01 | refs/heads/master | /omcor/clients/models.py | from __future__ import unicode_literals
from django.db import models
class Client(models.Model):
name = models.CharField(max_length=100)
fono = models.CharField(max_length=15)
email = models.EmailField(max_length=254, blank=True)
ci = models.CharField(max_length=15)
address = models.CharField(max_length=256)
de... | {"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]} |
44,827 | elektrodx/omcor-beta-v01 | refs/heads/master | /omcor/clients/admin.py | from django.contrib import admin
from .models import Client
@admin.register(Client)
class ClientAdmin(admin.ModelAdmin):
list_display = ('name', 'fono', 'email', 'ci', 'address')
| {"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]} |
44,828 | elektrodx/omcor-beta-v01 | refs/heads/master | /omcor/items/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-05 23:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
... | {"/omcor/order/admin.py": ["/omcor/order/models.py"], "/omcor/items/admin.py": ["/omcor/items/models.py"], "/omcor/clients/admin.py": ["/omcor/clients/models.py"]} |
44,829 | counter-king/ongorWebsite | refs/heads/main | /website/migrations/0010_remove_ordermodel_quantity.py | # Generated by Django 3.1.6 on 2021-02-09 10:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('website', '0009_remove_menuitem_quantity'),
]
operations = [
migrations.RemoveField(
model_name='ordermodel',
name='quantity... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,830 | counter-king/ongorWebsite | refs/heads/main | /website/models.py | from django.db import models
# Create your models here.
class MenuItem(models.Model):
name = models.CharField(max_length=100)
image = models.ImageField(upload_to='menu_images/')
price = models.DecimalField(max_digits=10, decimal_places=0)
category = models.ManyToManyField('Category', related_name='item')
def __s... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,831 | counter-king/ongorWebsite | refs/heads/main | /website/migrations/0006_auto_20210205_1904.py | # Generated by Django 3.1.6 on 2021-02-05 14:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0005_auto_20210204_1801'),
]
operations = [
migrations.AlterField(
model_name='menuitem',
name='quantity'... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,832 | counter-king/ongorWebsite | refs/heads/main | /website/migrations/0005_auto_20210204_1801.py | # Generated by Django 3.1.6 on 2021-02-04 13:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0004_menuitem_quantity'),
]
operations = [
migrations.AlterField(
model_name='ordermodel',
name='price',
... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,833 | counter-king/ongorWebsite | refs/heads/main | /website/migrations/0003_gallerymodel.py | # Generated by Django 3.1.6 on 2021-02-03 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0002_auto_20210203_1516'),
]
operations = [
migrations.CreateModel(
name='GalleryModel',
fields=[
... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,834 | counter-king/ongorWebsite | refs/heads/main | /website/views.py | from django.shortcuts import render
from django.views import View
from django.views.generic import ListView
from django.core.mail import send_mail
from .models import OrderModel, Category, MenuItem, GalleryModel
# Create your views here.
def home(request):
return render(request, 'home.html', {})
def about(request):
... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,835 | counter-king/ongorWebsite | refs/heads/main | /website/urls.py | from django.urls import path
from .import views
from .views import Order, Gallery
urlpatterns = [
path('', views.home, name="home"),
path('about/', views.about, name="about"),
path('contact/', views.contact, name="contact"),
# path('order/', views.order, name="order"),
path('order/', Order.as_view(... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,836 | counter-king/ongorWebsite | refs/heads/main | /website/migrations/0001_initial.py | # Generated by Django 3.1.6 on 2021-02-03 06:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField... | {"/website/views.py": ["/website/models.py"], "/website/urls.py": ["/website/views.py"]} |
44,883 | jester155/link-checker | refs/heads/master | /broken_link_crawler/spiders/broken-links-spider.py | __author__ = 'Mark'
from scrapy.contrib.spiders import CrawlSpider , Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from broken_link_crawler.items import BrokenItem
import broken_link_crawler.crawler_config as config
class BrokenSpider(CrawlSpider) :
name = config.name
allowed_domains ... | {"/broken_link_crawler/spiders/broken-links-spider.py": ["/broken_link_crawler/crawler_config.py"]} |
44,884 | jester155/link-checker | refs/heads/master | /broken_link_crawler/crawler_config.py |
name = 'broken_links'
allowed_domains = ['floridapolytechnic.org']
start_urls = ['https://floridapolytechnic.org']
| {"/broken_link_crawler/spiders/broken-links-spider.py": ["/broken_link_crawler/crawler_config.py"]} |
44,925 | mxrch/ecsc_discord_bot | refs/heads/main | /bot.py | from datetime import datetime
from discord.ext import tasks
from discord import Client, Embed
from lib.scoreboard import ECSC_Stats
CHANNEL_ID = "<The channel ID where you want the bot to send messages>"
BOT_TOKEN = "<Bot token>"
EACH_X_MINUTES = 15
FLAGS = {
"France": ":flag_fr:",
"Poland": ":flag_pl:",
... | {"/bot.py": ["/lib/scoreboard.py"]} |
44,926 | mxrch/ecsc_discord_bot | refs/heads/main | /lib/scoreboard.py | from copy import deepcopy
import httpx
from bs4 import BeautifulSoup as bs
class Country():
def __init__(self, index, name, points):
self.index = index
self.name = name
self.points = points
self.delta = 0 # 0 = not moving, 1 = up, 2 = down
def __eq__(self, other):
if ... | {"/bot.py": ["/lib/scoreboard.py"]} |
44,931 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /config/__init__.py | from .certificate import *
from .config_helper import *
| {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,932 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /crypto_utils/__init__.py | from .crypto_helper import *
| {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,933 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /actors/__init__.py | from .client import Client
from .merchant import Merchant
from .payment_gateway import PaymentGateway
| {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,934 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /config/certificate.py | from Crypto.PublicKey import RSA
from config.config_helper import *
def generate_certificates():
config = get_config_json()
logger = get_logger()
mpvk = RSA.generate(2048)
with open(config['merchant_private_key'], 'w') as f_mpvk:
f_mpvk.write(mpvk.exportKey('PEM').decode('UTF-8'))
lo... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,935 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /actors/merchant.py | import pickle
import random
import socket
from config.config_helper import get_config_json, get_logger
from crypto_utils.crypto_helper import encrypt_rsa_aes, decrypt_rsa_aes, verify_signature, sign
class Merchant:
def __init__(self):
self.config = get_config_json()
self.logger = get_logger()
... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,936 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /main.py | import os
import subprocess
import win32api
import config
if __name__ == "__main__":
config.generate_certificates()
module_directory = os.path.dirname(os.path.realpath(__file__))
python_venv_path = os.path.join(module_directory, r'venv\Scripts\python.exe')
pg_process = subprocess.Popen([python_venv_... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,937 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /crypto_utils/crypto_helper.py | import hashlib
import os
from Crypto.Cipher import AES
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Hash import SHA1
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_PSS
from Crypto.Util.Padding import pad, unpad
def sign(message, rsa_key):
if os.path.exists(rsa_key):
with open(rsa... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,938 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /actors/payment_gateway.py | import pickle
import socket
from config.config_helper import get_config_json, get_logger
from crypto_utils.crypto_helper import encrypt_rsa_aes, decrypt_rsa_aes, verify_signature, sign
class PaymentGateway:
def __init__(self):
self.config = get_config_json()
self.logger = get_logger()
sel... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,939 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /config/config_helper.py | import json
import logging
import os
import sys
def get_config_json():
module_directory = os.path.dirname(os.path.realpath(__file__))
config_abs_path = os.path.join(module_directory, r'config')
with open(config_abs_path, 'r') as fc:
config = json.load(fc)
# modify paths for files relative... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,940 | gheorghitamutu/SmartCardsApplicationsHomework | refs/heads/master | /actors/client.py | # SmartCardsApplicationsHomework\venv\Lib\site-packages\pycrypto-2.6.1-py3.7-win-amd64.egg\Crypto\Random\OSRNG\nt.py
# change import winrandom to from . import winrandom
# https://stackoverflow.com/questions/24804829/no-module-named-winrandom-when-using-pycrypto
import pickle
import socket
from Crypto.PublicKey impor... | {"/config/__init__.py": ["/config/certificate.py", "/config/config_helper.py"], "/crypto_utils/__init__.py": ["/crypto_utils/crypto_helper.py"], "/actors/__init__.py": ["/actors/client.py", "/actors/merchant.py", "/actors/payment_gateway.py"], "/config/certificate.py": ["/config/config_helper.py"], "/actors/merchant.py... |
44,946 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/posts/views.py | from django.shortcuts import render
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.http import Http404
from django.views import generic
from braces.views import SelectRelatedMixin
from django.contrib.messages.views import SuccessMessageMixin
from . import mode... | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,947 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/posts/templatetags/template_tags.py | from django import template
register = template.Library()
@register.simple_tag
def flag(value="True"):
return value | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,948 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/groups/templatetags/template_tags.py | '''from django import template
from ..models import Group,GroupMember
register = template.Library()
@register.inclusion_tag('grouped_list.html')
def Groups(user):
print(user)
get_user_groups = Group.objects.filter(members__user__username__contains=user)
print(get_user_groups)
get_other_groups = Group.objects.all(... | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,949 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/groups/admin.py | from django.contrib import admin
from . import models
# Register your models here.
class GroupMemberInline(admin.StackedInline):
model = models.GroupMember
class GroupAdmin(admin.ModelAdmin):
inlines = [GroupMemberInline,]
admin.site.register(models.Group,GroupAdmin)
admin.site.register(models.GroupMember) | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,950 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/posts/forms.py | from django import forms
from .models import Post
from groups.models import Group,GroupMember
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['message','group']
def __init__(self,user,*args,**kwargs):
super(PostForm,self).__init__(*args,**kwargs)
m... | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,951 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/posts/migrations/0003_auto_20201110_1953.py | # Generated by Django 3.1.1 on 2020-11-10 14:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0002_remove_post_message_html'),
]
operations = [
migrations.AlterUniqueTogether(
name='post',
unique_together=set(... | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,952 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/simplesocial/views.py | from django.views.generic import TemplateView
from django.views.generic import View
from groups.models import GroupMember,Group
class TestPage(TemplateView):
template_name = 'test.html'
class ThanksPage(TemplateView):
template_name = 'thanks.html'
class HomePage(TemplateView):
template_name = 'index.html'
| {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,953 | mohmedhsuhail/SocialMediaApp | refs/heads/master | /simplesocial/groups/views.py | from django.shortcuts import render
from django.contrib.auth.mixins import LoginRequiredMixin,PermissionRequiredMixin
from django.urls import reverse
from django.views import generic
from django.shortcuts import get_object_or_404
from django.contrib import messages
from groups.models import Group,GroupMember
from djang... | {"/simplesocial/posts/views.py": ["/simplesocial/posts/forms.py"]} |
44,982 | hyyc116/WOS_data_processing | refs/heads/master | /basic_attr_fetcher.py | #coding:utf-8
from basic_config import *
def subjnum_dis():
pid_subjs = json.loads(open('data/pid_subjects.json').read())
num_dis = defaultdict(int)
for pid in pid_subjs.keys():
subj_num = len(pid_subjs[pid])
num_dis[subj_num] += 1
xs = []
ys = []
for num in sorted(num_di... | {"/basic_attr_fetcher.py": ["/basic_config.py"], "/WOS_data_processing.py": ["/basic_config.py", "/basic_attr_fetcher.py"], "/attr_stats.py": ["/basic_config.py", "/WOS_data_processing.py"]} |
44,983 | hyyc116/WOS_data_processing | refs/heads/master | /basic_config.py | #coding:utf-8
import os
import sys
import json
from collections import defaultdict
from collections import Counter
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from sklearn.metrics import r2_score
import math
import numpy as np
import random
import logging... | {"/basic_attr_fetcher.py": ["/basic_config.py"], "/WOS_data_processing.py": ["/basic_config.py", "/basic_attr_fetcher.py"], "/attr_stats.py": ["/basic_config.py", "/WOS_data_processing.py"]} |
44,984 | hyyc116/WOS_data_processing | refs/heads/master | /WOS_data_processing.py | #coding:utf-8
'''
对wos数据库中的数据进行一系列的基本处理,以便于其他项目使用。
包括:
---基础数据
每篇论文的年份: pid_pubyear.json
每篇论文每年的被引次数: pid_year_citnum.json
每篇论文对应的作者数量: pid_teamsize.json
--- subject相关
每篇论文对应的subjects: pid_subjects.json pid_topsubjs.json
--- 用于计算学科之间的相似度
topsubject以及subject的参考文献数量... | {"/basic_attr_fetcher.py": ["/basic_config.py"], "/WOS_data_processing.py": ["/basic_config.py", "/basic_attr_fetcher.py"], "/attr_stats.py": ["/basic_config.py", "/WOS_data_processing.py"]} |
44,985 | hyyc116/WOS_data_processing | refs/heads/master | /attr_stats.py | #coding:utf-8
from basic_config import *
from WOS_data_processing import load_basic_data
import seaborn as sns
def citation_distribution():
logging.info('loading attrs ...')
pid_pubyear, pid_subjects, pid_topsubjs, pid_teamsize = load_basic_data()
logging.info('loading pid cn ...')
pid_cn = json.... | {"/basic_attr_fetcher.py": ["/basic_config.py"], "/WOS_data_processing.py": ["/basic_config.py", "/basic_attr_fetcher.py"], "/attr_stats.py": ["/basic_config.py", "/WOS_data_processing.py"]} |
45,001 | Sithlord-dev/rock_paper_scissors | refs/heads/main | /game.py | import random
def play(player1, player2, num_games, verbose=False):
""" Function that takes players for argument and the desired number of games, and return the winning rate of the
first player """
p1_prev_play = ""
p2_prev_play = ""
results = {"P1_win": 0, "P2_win": 0, "Tie": 0}
for _ in ran... | {"/main.py": ["/game.py", "/AI_player.py"]} |
45,002 | Sithlord-dev/rock_paper_scissors | refs/heads/main | /main.py | from game import play, cyril, christal, lana, dr_krieger, human, random_player
from AI_player import AI_player
# play(AI_player, cyril, 1000)
# play(AI_player, christal, 1000)
# play(AI_player, lana, 1000)
# play(AI_player, dr_krieger, 1000)
# Play interactively against one of the bots:
play(human, cyril, 20, verbos... | {"/main.py": ["/game.py", "/AI_player.py"]} |
45,003 | Sithlord-dev/rock_paper_scissors | refs/heads/main | /AI_player.py | # The example function below keeps track of the opponent's history and plays whatever the opponent played two plays ago.
# It is not a very good player so you will need to change the code to pass the challenge.
import numpy as np
# ideal response:
perfect_ans = {"P": "S", "R": "P", "S": "R"}
# reset variable
AI_moves ... | {"/main.py": ["/game.py", "/AI_player.py"]} |
45,010 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task3.py | from IMDB_task1 import movie_list
from pprint import pprint
# Task_3
def group_by_decade(movies):
movie_by_decade={}
for years in movies:
division=years['year']
decade=division // 10
divisi=decade*10
movie_by_decade[divisi]=[]
for de_year in movie_by_decade:
for movie in movies:
_division=movie['year'... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,011 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task13.py | from IMDB_task12 import All_movie_cast
from pprint import pprint
import os ,json
files=os.listdir("./IMD_data")
files_count = 0
for file_name in files:
if os.path.exists('IMD_data/'+file_name):
with open('IMD_data/'+file_name,'r')as file:
information = json.load(file)
information['ca... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,012 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task6.py | from pprint import pprint
from IMDB_task5 import get_movie_list_details
#Task_6
def analyse_movies_language(movies_list):
language_dict={}
Languages=[]
for language in movies_list:
for lan in language['language']:
if lan not in Languages:
Languages.append(lan)
for Languages_list in Languages:
count=0
... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,013 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task4.py | from IMDB_task1 import movie_list
from pprint import pprint
import requests
from bs4 import BeautifulSoup
def scrape_movie_details(movie_url):
movie_downlod=requests.get(movie_url)
suop=BeautifulSoup(movie_downlod.text,'html.parser')
movie_title=suop.find('div',class_='title_bar_wrapper')
movie_name=movie_tit... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,014 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task5.py | from IMDB_task1 import movie_list
from IMDB_task4 import scrape_movie_details
from pprint import pprint
# Task_5
def get_movie_list_details(movies_list):
movie_url_list=[]
ten_movie_url=(movies_list[:10])
for All_url in ten_movie_url:
movie_url_li=scrape_movie_details(All_url['url'])
movie_url_list.append(movi... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,015 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task8_9.py | from IMDB_task4 import scrape_movie_details
from IMDB_task1 import movie_list
from pprint import pprint
import os.path,json,time,random
# Task 8 and 9
timer = random.randint(1,3)
def movies_json():
all_movies_dicts=[]
for all_movies in movie_list:
movie_url = all_movies['url']
ID=''
for ... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,016 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDb_scraper.py | import requests
from bs4 import BeautifulSoup
import pprint,os.path
import time,random,json
from urllib.request import urlopen
url='https://www.imdb.com/india/top-rated-indian-movies/'
movie=requests.get(url)
# print (movie.text)
suop=BeautifulSoup(movie.text,"html.parser")
# print (suop.title)
# Task_1
def scrape_t... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,017 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task7.py | from IMDB_task5 import get_movie_list_details
from pprint import pprint
#Task_7
def analyse_movies_directors(director_data):
Director_dict={}
director_list=[]
for director in director_data:
for film_Director in director['director']:
if film_Director not in director_list:
director_list.append(film_Director... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,018 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task1.py | import requests
from bs4 import BeautifulSoup
from pprint import pprint
url='https://www.imdb.com/india/top-rated-indian-movies/'
movie=requests.get(url)
suop=BeautifulSoup(movie.text,"html.parser")
# Task_1
def scrape_top_list():
movie_div=suop.find("div", class_='lister')
table_=movie_div.find("tbody",class_='l... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,019 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task11.py | from IMDB_task8_9 import Movies_Dict
from pprint import pprint
# Task_11
def analyse_movies_genre(movie_data):
genres_list=[]
for genres in movie_data:
for one_genres in genres['genre']:
if one_genres not in genres_list:
genres_list.append(one_genres)
total_value={}
All_genres=[]
for genres_ in movie_da... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,020 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task2.py | from IMDB_task1 import movie_list
from pprint import pprint
#Task_2
def group_by_year(movies):
movie_by_year={}
for movie in movies:
movie_by_year[movie['year']]=[]
# print(movie_by_year)
for year_key in movie_by_year:
for movie_ in movies:
year=movie_['year']
if year==year_key:
movie_by_year[year]... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,021 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task10.py | from IMDB_task8_9 import Movies_Dict
import json
from pprint import pprint
# Task 10
def analyse_language_and_directors(Dict):
list_1=[]
for i in Dict:
a=(i["director"])
for j in a:
if j not in list_1:
list_1.append(j)
# print(list_1)
director_dict={}
for k in list_1:
list_2=[]
list_3=[]
fo... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,022 | prakash-simhandri/IMDB_scraper | refs/heads/master | /IMDB_task12.py | from IMDB_task1 import movie_list
import requests
from bs4 import BeautifulSoup
from urllib.request import urlopen
from pprint import pprint
# Task 12
def scrape_movie_cast(movie_caste_url):
All_movies_cast_list = []
count=0
for caste_url in movie_caste_url:
M_caste_url=caste_url['url']
ID='... | {"/IMDB_task3.py": ["/IMDB_task1.py"], "/IMDB_task13.py": ["/IMDB_task12.py"], "/IMDB_task6.py": ["/IMDB_task5.py"], "/IMDB_task4.py": ["/IMDB_task1.py"], "/IMDB_task5.py": ["/IMDB_task1.py", "/IMDB_task4.py"], "/IMDB_task8_9.py": ["/IMDB_task4.py", "/IMDB_task1.py"], "/IMDB_task7.py": ["/IMDB_task5.py"], "/IMDB_task11... |
45,027 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /tests/test_ml.py | """
Tests for net.ml module
"""
import numpy as np
import tensorflow as tf
import net.ml
def test_get_distance_matrix_op():
"""
Test computing a matrix of distances between all rows permutations of a matrix.
"""
inputs_matrix = np.array([
[1, 3, 5, 7],
[2, 2, 4, 4],
[1.5, -2... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,028 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/analysis.py | """
Module with analysis logic
"""
import numpy as np
import scipy.spatial.distance
import tensorflow as tf
import tqdm
def get_indices_of_k_most_similar_vectors(vectors, k):
"""
Given 2D matrix of vectors laid out row-wise compute euclidean distances between all vectors pairs,
and then for each vector r... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,029 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/constants.py | """
Module with constants
"""
import enum
class DatasetMode(enum.Enum):
"""
Simple enum to differentiate between training and validation datasets
"""
TRAINING = 0
VALIDATION = 1
| {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,030 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/processing.py | """
Module with processing code
"""
import cv2
import numpy as np
def get_image_padded_to_square_size(image):
"""
Pad image to square size with zeros
:param image: image
:type image: 3D numpy array
:return: 3D numpy array
"""
height, width = image.shape[:2]
height_padding = width -... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,031 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/logging.py | """
Module with logging utilities
"""
import os
import random
import cv2
import numpy as np
import vlogging
import net.analysis
import net.processing
class ImageRankingLogger:
"""
Class for visualizing image ranking results
"""
def __init__(self, logger, prediction_model):
"""
Cons... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,032 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/data.py | """
Module with data related code
"""
import collections
import functools
import os
import random
import cv2
import imgaug
import numpy as np
import scipy.io
import net.constants
import net.processing
class Cars196Annotation:
"""
Class for representing one sample of Cars196 dataset
"""
def __init_... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,033 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /tasks.py | """
Module with invoke tasks
"""
import invoke
import net.invoke.analysis
import net.invoke.docker
import net.invoke.tests
import net.invoke.ml
import net.invoke.visualize
# Default invoke collection
ns = invoke.Collection()
# Add collections defined in other files
ns.add_collection(net.invoke.analysis)
ns.add_coll... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,034 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/invoke/visualize.py | """
Module with visualization related tasks
"""
import invoke
@invoke.task
def visualize_data(_context, config_path):
"""
Visualize data
:param _context: context
:type _context: invoke.Context
:param config_path: path to configuration file
:type config_path: str
"""
import tqdm
... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,035 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/invoke/docker.py | """
Module with docker related commands
"""
import invoke
@invoke.task
def run(context, config_path):
"""
Run docker container for the app
:param context: invoke.Context instance
:param config_path: str, path to configuration file
"""
import os
import net.utilities
config = net.ut... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,036 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /tests/test_analysis.py | """
Tests for analysis module
"""
import numpy as np
import net.analysis
def test_get_indices_of_k_most_similar_vectors():
"""
Test get_indices_of_k_most_similar_vectors
"""
vectors = np.array([
[1, 1],
[10, 10],
[2.5, 2.5],
[5, 5],
[8, 8]
])
actual ... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,037 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/invoke/analysis.py | """
Module with analysis tasks
"""
import invoke
@invoke.task
def analyze_model_performance(_context, config_path):
"""
Analyze model performance
:param _context: invoke.Context instance
:param config_path: str, path to configuration file
"""
import tensorflow as tf
import net.analysis... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,038 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/ml.py | """
Module with machine learning code
"""
import tensorflow as tf
def get_auxiliary_categorization_head(x, categories_count):
"""
Get a simple categorization head
:param x: 2D tensor op, batch of 1D vectors
:param categories_count: int, number of categories for auxiliary categorization head's output... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,039 | fatejzz/combination_of_multiple_global_descriptors_for_image_retrieval | refs/heads/master | /net/invoke/ml.py | """
Module with machine learning tasks
"""
import invoke
@invoke.task
def train(_context, config_path):
"""
Train model
:param _context: invoke.Context instance
:param config_path: str, path to configuration file
"""
import tensorflow as tf
import net.constants
import net.data
... | {"/tests/test_ml.py": ["/net/ml.py"], "/net/logging.py": ["/net/analysis.py", "/net/processing.py"], "/net/data.py": ["/net/constants.py", "/net/processing.py"], "/tasks.py": ["/net/invoke/analysis.py", "/net/invoke/docker.py", "/net/invoke/ml.py", "/net/invoke/visualize.py"], "/net/invoke/visualize.py": ["/net/data.py... |
45,040 | shalman13091994/lapnew | refs/heads/master | /newbee/firstapp/admin.py | from django.contrib import admin
from.models import person
admin.site.register(person)
| {"/newbee/firstapp/urls.py": ["/newbee/firstapp/views.py"]} |
45,041 | shalman13091994/lapnew | refs/heads/master | /newbee/firstapp/urls.py | from django.urls import path
from.views import homepage,welcome,password
urlpatterns=[
path('',homepage,name='home'),
path('welcome',welcome,name='welcome'),
path('password',password,name='pass'),
path('home',homepage,name='home')
] | {"/newbee/firstapp/urls.py": ["/newbee/firstapp/views.py"]} |
45,042 | shalman13091994/lapnew | refs/heads/master | /newbee/firstapp/views.py | from django.shortcuts import render
from .models import person
from django.http import HttpResponse
def homepage(request):
allpost=person.objects.all()
return render(request,'home.html',{'posts':allpost})
def welcome(request):
nam =request.POST['uname']
pas=request.POST['psw']
mod=nam+' '+pas
retur... | {"/newbee/firstapp/urls.py": ["/newbee/firstapp/views.py"]} |
45,056 | simonno/FinalProject | refs/heads/master | /createMalware.py | import os
import createImages
import badImage
def main():
# Create the images
images = createImages.createImages()
newList = os.listdir("train50")
for i in range(500):
image = "Images/image" + i.__str__() + ".png"
malware = "train50/" + newList[i % len(newList)]
badImage.crea... | {"/createMalware.py": ["/badImage.py"]} |
45,057 | simonno/FinalProject | refs/heads/master | /createCSV.py | import csv
import random
from sklearn.model_selection import train_test_split
from PIL import Image
import numpy as np
import pandas as pd
import xgboost as xgb
with open("classification_data.csv", "wb") as csv_file:
writer = csv.writer(csv_file)
newArray = []
for i in range(1000):
image = Image.... | {"/createMalware.py": ["/badImage.py"]} |
45,058 | simonno/FinalProject | refs/heads/master | /badImage.py | import cv2 # OpenCV 2
from random import randint
from os import listdir
from os.path import isfile, join
def to_bit_generator(msg):
"""Converts a message into a generator which returns 1 bit of the message
each time."""
for c in (msg):
o = ord(c)
for i in range(8):
yield (o & (... | {"/createMalware.py": ["/badImage.py"]} |
45,059 | simonno/FinalProject | refs/heads/master | /machineLearning.py | import csv
import random
from sklearn.model_selection import train_test_split
from PIL import Image
import numpy as np
import pandas as pd
import xgboost as xgb
class_data = pd.read_csv("classification_data.csv")
X, y = class_data.iloc[:, :-1], class_data.iloc[:, -1]
X_train, X_test, y_train, y_test = train_test_spl... | {"/createMalware.py": ["/badImage.py"]} |
45,061 | dmkaraba/green-house | refs/heads/master | /test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
from modules.greenhouse.objects import Lifecycle
from web_interface.web_events.config_requests import CreateLifecycle, Timer, Conditions
from datetime import datetime
from handlers.jobs import watch_for_soilmoisture_a, watch_for_fans, watch_for_light... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,062 | dmkaraba/green-house | refs/heads/master | /config/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
base_dir = os.path.join(os.path.dirname(__file__), '..')
class Config(object):
temp_dir = os.path.join(base_dir, 'tmp')
log_dir = os.path.join(base_dir, 'logs')
camera_dir = temp_dir
def __init__(self, conf):
self._data = ... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,063 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/objects.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from modules.data.db import DBSharedProperty
from modules.greenhouse.models import SensorResultsDoc, \
SoilConditions, SoilMoistureConditions,\
AirInsideConditions, AirOutsideConditions, \
... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,064 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from modules.data.db import DBDocument
from mongoengine import EmbeddedDocument, EmbeddedDocumentField, StringField,\
IntField, BooleanField, ListField, MapField, DynamicField, \
ObjectIdField, DateTimeField, ... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,065 | dmkaraba/green-house | refs/heads/master | /modules/mqtt_interaction/handlers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import signal
class SensorsMQTTDmn(object):
def __init__(self):
self.kill_now = False
def exit_pub_loop(self, signum, frame):
# print 'exit_pub_loop'
self.kill_now = True
self.mqtt_connection.disconnect()
def run... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,066 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/sensors.py | #!/usr/bin/python
import time
import Adafruit_ADS1x15
import Adafruit_DHT as dht
import smbus
import utils.logger as logger
from config import config
from modules.greenhouse.sensor_answers import DS18B20Result, BH1750Result, DHT22Result, SoilMoistureResult
class BaseSensor(object):
NAME = None
@classmethod... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,067 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/lifecycle.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from datetime import date as dt
from datetime import time as tm
from modules.greenhouse.objects import Lifecycle
from utils.mixins import DateComparison, TimeComparison
from modules.const import PERFORMERS, SENSORS
from utils.logger import info
def compar... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,068 | dmkaraba/green-house | refs/heads/master | /handlers/jobs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from modules.greenhouse.camera import Camera
from modules.greenhouse.lifecycle import TimerWatchdog, ConditinsWatchdog
from modules.greenhouse.objects import SensorResults
from utils.sensors.reader import pull_data
def insert_all_conditions():
print '>>> insert all c... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,069 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/sensor_answers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from schematics.models import Model
from schematics.types.compound import ModelType
from schematics import types
class BaseSensorResult(Model):
rc = types.IntType(default=0)
class BH1750Result(BaseSensorResult):
luminosity = types.FloatType()
class DHT22Resul... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,070 | dmkaraba/green-house | refs/heads/master | /handlers/tasks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from config import config
from utils.deploy.celeryd import app as celeryd_app
from utils.deploy.celerybeat import app as celerybeat_app
@celerybeat_app.task(ignore_result=True, queue='main')
def insert_all_conditions():
from handlers.jobs import insert_all_conditions... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,071 | dmkaraba/green-house | refs/heads/master | /utils/deploy/celerybeat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import timedelta
from celery import Celery
from celery.schedules import crontab
from config import config
schedules = {}
for k, schedule in config.celerybeat['CELERYBEAT_SCHEDULE'].items():
if 'timedelta' in schedule['schedule']:
schedule['sch... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,072 | dmkaraba/green-house | refs/heads/master | /utils/video/sequence.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, glob, json
from moviepy.editor import ImageClip, TextClip, CompositeVideoClip, ImageSequenceClip
from configer import ConfigCreator, ConfigDefaults
class SequenceProcessing(object):
def __init__(self):
config = ConfigCreator()
config... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,073 | dmkaraba/green-house | refs/heads/master | /utils/mixins.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import date, time
class DateComparison(date):
"""
Additional logic to compare <datetime> with <str>
"""
def __ge__(self, y):
if not y:
return False
return date(self.year, self.month, self.day) >= y
def __le_... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,074 | dmkaraba/green-house | refs/heads/master | /app/test_all.py | #!/usr/bin/python
from modules.greenhouse.sensors import DS18B20_Air, DS18B20_Soil
from modules.greenhouse.sensors import BH1750, DHT22, SoilMoistureSensors
from modules.greenhouse.controllers import Light, Fan, Pump, Servo
from time import sleep
def test_sensors():
sensors = (DS18B20_Air, DS18B20_Soil, BH1750,
... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,075 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/controllers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import RPi.GPIO as GPIO
import utils.logger as logger
from config import config
class RelayBase(object):
"""
Controlling relay performers here.
Usage (lights for example):
# If we want to switch lights on
Light.on()
# If we want to s... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,076 | dmkaraba/green-house | refs/heads/master | /modules/const.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from modules.greenhouse.controllers import PumpA, PumpB, Light, Fan
from modules.greenhouse.sensors import BH1750, DHT22, DS18B20_Air, DS18B20_Soil,\
SoilMoistureA, SoilMoistureB
SENSORS = {
'soil_moisture_a': SoilMoistureA, # ... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,077 | dmkaraba/green-house | refs/heads/master | /app/tear_down.py | #!/usr/bin/python
import RPi.GPIO as GPIO
def cleanup():
GPIO.cleanup()
if __name__ == '__main__':
cleanup()
| {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,078 | dmkaraba/green-house | refs/heads/master | /web_interface/web_events/config_requests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from schematics import types
from schematics.models import Model
from schematics.types.compound import ModelType
### LIFECYCLE ###################################
class Timer(Model):
start_date = types.DateTimeType()
end_date = types.DateTimeType()
start_tim... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,079 | dmkaraba/green-house | refs/heads/master | /modules/mqtt_interaction/base.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import signal
import paho.mqtt.client as mqtt
from config import config
from modules.greenhouse.controllers import Light, Fan, Pump
class Base_GHMQTT(mqtt.Client):
USERNAME = config.cloud_mqtt_cred['user']
PASSWORD = config.cloud_mqtt_cred['pass']
... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,080 | dmkaraba/green-house | refs/heads/master | /modules/data/db.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mongoengine import *
from config import config
from modules.data.connections import mongo_connection
class DBSharedProperty(object):
def __init__(self, name):
self.name = name
def __get__(self, obj, objtype=None):
if obj is None:
... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,081 | dmkaraba/green-house | refs/heads/master | /utils/logger/__init__.py | #!/usr/bin/python
import os
import logging
from config import Config
config_dir = Config.log_dir
def debug(msg):
logging.basicConfig(filename=os.path.join(config_dir, 'debug.log'), level=logging.DEBUG,
format="%(asctime)s %(levelname)s: %(message)s",
datefmt='%d-%... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,082 | dmkaraba/green-house | refs/heads/master | /modules/greenhouse/camera.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import subprocess
from config import config
camera_dir = config.camera_dir
class Camera(object):
@classmethod
def shoot(cls):
frame_name = '.'.join((str(int(time.time())), 'jpg'))
frame_dir = os.path.join(camera_dir, frame... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,083 | dmkaraba/green-house | refs/heads/master | /utils/deploy/celeryd.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from celery import Celery
from config import config
# app = Celery('main_app',
# broker='amqp://guest@localhost//',
# include=['handlers.tasks'])
#
# app.conf.timezone = 'Europe/Minsk'
app = Celery()
app.conf.update(config.celeryd)
| {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,084 | dmkaraba/green-house | refs/heads/master | /handlers/__init__.py | #!/usr/bin/python
# all mesurment logics here
| {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,085 | dmkaraba/green-house | refs/heads/master | /app/set_up.py | # GPIO setup must be here | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
45,086 | dmkaraba/green-house | refs/heads/master | /utils/sensors/reader.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from modules.greenhouse.sensor_answers import AllSensorsResult
from modules.greenhouse.sensors import DS18B20_Air, DS18B20_Soil, \
BH1750, DHT22, SoilMoistureSensors
def pull_data():
sm = SoilMoistureSensors()
res = AllSenso... | {"/modules/greenhouse/objects.py": ["/modules/data/db.py", "/modules/greenhouse/models.py"], "/modules/greenhouse/models.py": ["/modules/data/db.py"], "/modules/mqtt_interaction/handlers.py": ["/utils/sensors/reader.py", "/modules/mqtt_interaction/base.py"], "/modules/greenhouse/sensors.py": ["/utils/logger/__init__.py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.