index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
56,002
nathananderson03/soundproof
refs/heads/master
/soundproof/instagram.py
#pylint: skip-file from __future__ import absolute_import, print_function import sys import pickle import time import datetime import re import json import urlparse import traceback from httplib import ResponseNotReady from httplib2 import ServerNotFoundError from django.conf import settings from django.core.urlreso...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,003
nathananderson03/soundproof
refs/heads/master
/soundproof/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import soundproof.models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,004
nathananderson03/soundproof
refs/heads/master
/soundproof/models.py
#pylint: skip-file from __future__ import absolute_import, print_function import hashlib import re import os import string import json import time import datetime from django.conf import settings from django.db import models from django.core.urlresolvers import reverse from django.template import Context, Template f...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,005
nathananderson03/soundproof
refs/heads/master
/soundproof/migrations/0004_auto_20150507_1204.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('soundproof', '0003_auto_20150507_1200'), ] operations = [ migrations.RemoveField( model_name='follower', ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,006
nathananderson03/soundproof
refs/heads/master
/soundproof/middleware/exception_logger.py
import logging logger = logging.getLogger(__name__) class ExceptionLogger(object): def process_exception(self, request, exception): #logger.exception(exception) print exception
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,007
nathananderson03/soundproof
refs/heads/master
/soundproof/data_store.py
from __future__ import absolute_import from django.conf import settings import kvstore _image_store = None def image_store(): global _image_store if not _image_store: _image_store = kvstore.create(**settings.STORES['image']['kvstore']) return _image_store
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,008
nathananderson03/soundproof
refs/heads/master
/soundproof/migrations/0009_auto_20150529_1535.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('soundproof', '0008_auto_20150514_1117'), ] operations = [ migrations.AddField( model_name='display', ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,009
nathananderson03/soundproof
refs/heads/master
/soundproof/management/commands/subscribe.py
import requests from django.core.management.base import BaseCommand, CommandError from django.conf import settings class Command(BaseCommand): def handle(self, *args, **kwargs): r = requests.post('https://api.instagram.com/v1/subscriptions/',data={ 'client_id':settings.INSTAGRAM_ID, ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,010
nathananderson03/soundproof
refs/heads/master
/soundproof/migrations/0007_display_public_analytics.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('soundproof', '0006_auto_20150507_1316'), ] operations = [ migrations.AddField( model_name='display', ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,011
nathananderson03/soundproof
refs/heads/master
/soundproof/views.py
# pylint: skip-file from __future__ import absolute_import, print_function import traceback import json import pytz import random from StringIO import StringIO from collections import namedtuple from django.db.models import Q, Sum, Min, Max, Count from django.http import HttpResponse, HttpResponseRedirect, Http404 fr...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,012
nathananderson03/soundproof
refs/heads/master
/soundproof/site_settings_example.py
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'soundproof_feed', 'USER': 'root', 'PASSWORD': '', } } CACHES = { 'default':{ 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', }, } ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,013
nathananderson03/soundproof
refs/heads/master
/soundproof/settings.py
""" Django settings for soundproof project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ from __future__ import absolute_import, print_function # Build paths in...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,014
nathananderson03/soundproof
refs/heads/master
/soundproof/management/commands/refresh_images.py
#pylint: skip-file from __future__ import absolute_import, print_function import datetime import time from django.core.management.base import BaseCommand from django.conf import settings from django.core.cache import cache from django.utils.timezone import now, get_current_timezone from ...models import InstagramIm...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,015
nathananderson03/soundproof
refs/heads/master
/soundproof/migrations/0003_auto_20150507_1200.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('soundproof', '0002_follower'), ] operations = [ migrations.CreateModel...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,016
nathananderson03/soundproof
refs/heads/master
/soundproof/deployment_settings/heroku.py
import os # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False TEMPLATE_DEBUG = False STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' ALLOWED_HOSTS = [ '.herokuapp.com', ] BASE_DIR = os.path.dirname(os.path.dirname(__file__)) LOGGING = { 'version': 1, ...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,017
nathananderson03/soundproof
refs/heads/master
/soundproof/management/commands/report.py
import datetime from django.core.management.base import BaseCommand from django.utils.timezone import get_current_timezone from soundproof.models import InstagramImage from soundproof.instagram import get_report TAGS = ('udaustralia',) PERIOD = ( datetime.datetime(2015, 3, 27, 0, 0, tzinfo=get_current_timezone()...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,018
nathananderson03/soundproof
refs/heads/master
/soundproof/management/commands/instagram_daemon.py
#pylint: skip-file from __future__ import absolute_import, print_function import datetime import time from django.core.management.base import BaseCommand from django.conf import settings from django.core.cache import cache from django.utils.timezone import now, get_current_timezone from ...models import * from ...i...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,019
nathananderson03/soundproof
refs/heads/master
/soundproof/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from .views import ( SubscriptionsView, ModerateView, AnalyticsView, GridConfigView, PhotoSelectView, ) urlpatterns = patterns( 'soundproof.views', url(r'^instagram$', 'instagram_callback', name='instagram...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,020
nathananderson03/soundproof
refs/heads/master
/soundproof/management/commands/instagram_update.py
from __future__ import absolute_import, print_function from django.core.management.base import BaseCommand from ... import instagram class Command(BaseCommand): def __init__(self): super(Command, self).__init__() def handle(self, *args, **kwargs): for tag in args: print('Loading ta...
{"/soundproof/admin.py": ["/soundproof/models.py"], "/microsite/urls.py": ["/microsite/views.py"], "/soundproof/instagram.py": ["/soundproof/models.py"], "/soundproof/migrations/0001_initial.py": ["/soundproof/models.py"], "/soundproof/management/commands/refresh_images.py": ["/soundproof/models.py", "/soundproof/insta...
56,040
titanbt/deep_memNN
refs/heads/master
/loader/data_helper.py
import os from collections import Counter import xml.etree.ElementTree as ET class DataHelper(object): def __init__(self, train_file, test_file, edim, init_std, embedding_path=None): self.train_file = train_file self.test_file = test_file self.embedding_path = embedding_pa...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,041
titanbt/deep_memNN
refs/heads/master
/utils/commandParser.py
import argparse def DLNLPOptParser(): parser = argparse.ArgumentParser(\ description='Default DLNLP opt parser.') parser.add_argument('-mode', default='deep_memNN') parser.add_argument('-config',default='config/sentence_memNN.cfg', help='config file to set.') return parser.parse_arg...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,042
titanbt/deep_memNN
refs/heads/master
/main.py
from utils.commandParser import DLNLPOptParser import warnings from model.sentence_memNN_main import SentenceMemNNMain warnings.simplefilter("ignore", DeprecationWarning) if __name__ == '__main__': args = DLNLPOptParser() config = args.config if args.mode == 'deep_memNN': deep_memNN = SentenceMe...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,043
titanbt/deep_memNN
refs/heads/master
/loader/funcs.py
import numpy as np import theano import loader.libs.utils as utils from loader.libs.alphabet import Alphabet logger = utils.get_logger("LoadData") MAX_LENGTH = 140 def load_dataset_sequence_labeling(train_path, test_path, word_column=0, target_column=1, label_column=2, label_name='...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,044
titanbt/deep_memNN
refs/heads/master
/model/sentence_memNN_main.py
from ConfigParser import SafeConfigParser from loader.data_helper import DataHelper from nn.sentence_memNN import SentenceMemNN import numpy as np import math import tensorflow as tf class SentenceMemNNMain(object): def __init__(self, config=None, opts=None): if config == None and opts == None: ...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,045
titanbt/deep_memNN
refs/heads/master
/nn/sentence_memNN.py
from sklearn.preprocessing import LabelBinarizer import numpy as np import tensorflow as tf from sklearn import metrics import lasagne.nonlinearities as nonlinearities class SentenceMemNN(object): def __init__(self, nwords=0, init_hid=0.1, init_std=0.05, batch_size=128, num_epochs=100, num_hops=7, embedd_dim=300, ...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,046
titanbt/deep_memNN
refs/heads/master
/loader/data_loader.py
import loader.funcs as funcs class DataLoader(object): def __init__(self, train_file, test_file, word_column, label_column, target_column, oov='embedding', embedding='glove', embedding_path=None): self.train_file = train_file self.test_file = test_file self.word_column = w...
{"/main.py": ["/utils/commandParser.py", "/model/sentence_memNN_main.py"], "/loader/data_loader.py": ["/loader/funcs.py"]}
56,106
kiviev/createplaylist
refs/heads/master
/functions.py
#!/usr/bin/env python3 import os def find_files(files, dirs=[], extensions=[] , search = ''): new_dirs = [] search = search.lower() repace_underscore = search.replace("_" , " ") replace_blank = search.replace(" " , "_") for d in dirs: try: new_dirs += [ os.path.join(d, f) for f in os.listdir(d) ] except...
{"/crearPlaylistSingle.py": ["/functions.py", "/config.py"], "/Sample_mySearch.py": ["/functions.py"]}
56,107
kiviev/createplaylist
refs/heads/master
/crearPlaylistSingle.py
#!/usr/bin/env python3 import os ,argparse from functions import * from config import * # comienza ejecucion files = [] search = args.search pathOutputPlaylist = args.path dirs = [args.dir] extensiones = extensions[args.type] if args.filename: newFilename = args.filename else : newFilename = search print(searc...
{"/crearPlaylistSingle.py": ["/functions.py", "/config.py"], "/Sample_mySearch.py": ["/functions.py"]}
56,108
kiviev/createplaylist
refs/heads/master
/Sample_mySearch.py
#!/usr/bin/env python3 ########## # remove from this file part of the name "Sample_" and with it you can work ########## from functions import createPlayListSingle AllArray = { "rock" : ["Led Zeppelin","Iron Maiden","Metallica"], "acction" :["Rambo","Rambo 2","Rambo 3"], "travel" : ["Hawai","Roma","Paris","...
{"/crearPlaylistSingle.py": ["/functions.py", "/config.py"], "/Sample_mySearch.py": ["/functions.py"]}
56,109
kiviev/createplaylist
refs/heads/master
/AllPlaylist.py
#!/usr/bin/env python3 import os from mySearch import *
{"/crearPlaylistSingle.py": ["/functions.py", "/config.py"], "/Sample_mySearch.py": ["/functions.py"]}
56,110
kiviev/createplaylist
refs/heads/master
/config.py
#!/usr/bin/env python3 import os ,argparse parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument("-f", "--file", dest="filename", help="Nombre de salida del archivo FILE", metavar="FILE") parser.add_argument("-p", "--path", dest="path", help="...
{"/crearPlaylistSingle.py": ["/functions.py", "/config.py"], "/Sample_mySearch.py": ["/functions.py"]}
56,120
flmn/rqalpha
refs/heads/master
/rqalpha/plot.py
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
{"/rqalpha/mod/analyser/mod.py": ["/rqalpha/plot.py"]}
56,121
flmn/rqalpha
refs/heads/master
/rqalpha/mod/analyser/mod.py
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
{"/rqalpha/mod/analyser/mod.py": ["/rqalpha/plot.py"]}
56,122
flmn/rqalpha
refs/heads/master
/rqalpha/model/account/future_account.py
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
{"/rqalpha/mod/analyser/mod.py": ["/rqalpha/plot.py"]}
56,124
buraktekin/barrkoda
refs/heads/master
/app.py
from pyzbar import pyzbar from imutils.video import VideoStream from imutils.video import FPS from modules.detect_barcodes import Detector import argparse as ap import numpy as np import datetime import time import imutils import cv2 # argument parser args_parser = ap.ArgumentParser() args_parser.add_argument("-nf", ...
{"/app.py": ["/modules/detect_barcodes.py"]}
56,125
buraktekin/barrkoda
refs/heads/master
/modules/detect_barcodes.py
import cv2 import matplotlib.pyplot as plt import numpy as np class Detector: def __init__(self, frame): self.frame = frame self.scale = 800 self.image = cv2.cvtColor(frame, cv2.IMREAD_GRAYSCALE) self.image_out = frame # will be fixed def scale_image(self): self.scale =...
{"/app.py": ["/modules/detect_barcodes.py"]}
56,128
fsay2604/PI_maison_intelligente
refs/heads/main
/Sensor/gas_sensor.py
#!/usr/bin/env python ########################################################################## # Auteurs: Francois Charles Hebert & Samuel Fournier # Classe: Représente le sensor de gaz. (pour notre détecteur de fumé) ########################################################################## class Gas_Sensor: # C...
{"/publisher_sensors.py": ["/Sensor/flame_sensor.py", "/Sensor/gas_sensor.py"], "/main.py": ["/Sensor/ventilation.py", "/Sensor/lcd.py"]}
56,129
fsay2604/PI_maison_intelligente
refs/heads/main
/publisher_sensors.py
#!/usr/bin/env python3 ########################################################################## # Auteurs: Francois Charles Hebert & Samuel Fournier # Projet: Système d'alarme d'une maison. ########################################################################## # Imports import paho.mqtt.client as mqtt import...
{"/publisher_sensors.py": ["/Sensor/flame_sensor.py", "/Sensor/gas_sensor.py"], "/main.py": ["/Sensor/ventilation.py", "/Sensor/lcd.py"]}
56,130
fsay2604/PI_maison_intelligente
refs/heads/main
/Sensor/ventilation.py
from gpiozero import Device, Motor, OutputDevice from gpiozero.pins.pigpio import PiGPIOFactory import time class ventilation: # defining variables MOTOR_PINS = [23, 24] ENABLE_PIN = 18 motor = None def __init__(self): self.motor = Motor(forward=self.MOTOR_PINS[1], backward=self.MOTOR_...
{"/publisher_sensors.py": ["/Sensor/flame_sensor.py", "/Sensor/gas_sensor.py"], "/main.py": ["/Sensor/ventilation.py", "/Sensor/lcd.py"]}
56,131
fsay2604/PI_maison_intelligente
refs/heads/main
/main.py
#!/usr/bin/env python ########################################################################## # Auteurs: Francois Charles Hebert & Samuel Fournier # Projet: Système d'alarme d'une maison. ########################################################################## # Imports import RPi.GPIO as GPIO from gpiozero i...
{"/publisher_sensors.py": ["/Sensor/flame_sensor.py", "/Sensor/gas_sensor.py"], "/main.py": ["/Sensor/ventilation.py", "/Sensor/lcd.py"]}
56,132
fsay2604/PI_maison_intelligente
refs/heads/main
/Sensor/lcd.py
#!/usr/bin/env python3 ######################################################################## # Filename : I2CLCD1602.py # Description : Use the LCD display data # Author : freenove # modification: 2018/08/03 ######################################################################## from Sensor import PCF8574 f...
{"/publisher_sensors.py": ["/Sensor/flame_sensor.py", "/Sensor/gas_sensor.py"], "/main.py": ["/Sensor/ventilation.py", "/Sensor/lcd.py"]}
56,133
fsay2604/PI_maison_intelligente
refs/heads/main
/Sensor/flame_sensor.py
#!/usr/bin/env python ########################################################################## # Auteurs: Francois Charles Hebert & Samuel Fournier # Classe: Représente le sensor de flamme. ########################################################################## import RPi.GPIO as GPIO from ADCDevice import * fr...
{"/publisher_sensors.py": ["/Sensor/flame_sensor.py", "/Sensor/gas_sensor.py"], "/main.py": ["/Sensor/ventilation.py", "/Sensor/lcd.py"]}
56,178
rmeritz/pycon-sweden-2015
refs/heads/master
/models.py
## job/models.py from django.db import models from .managers import JobsManager class Job(models.Model): objects = JobsManager() name = models.CharField(blank=False, max_length=100, null=False) published = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) up...
{"/forms.py": ["/models.py"], "/routes.py": ["/views.py"]}
56,179
rmeritz/pycon-sweden-2015
refs/heads/master
/views.py
# Class Based Views: # http://ccbv.co.uk/
{"/forms.py": ["/models.py"], "/routes.py": ["/views.py"]}
56,180
rmeritz/pycon-sweden-2015
refs/heads/master
/forms.py
# jobs/forms.py from datetime import timedelta from django import forms from obscene import is_obscene from .models import Job class JobCreateForm(forms.ModelForm): class Meta: model = Job fields = ["name", "description", "start_date"] def clean_name(self): name = self.cleaned_data....
{"/forms.py": ["/models.py"], "/routes.py": ["/views.py"]}
56,181
rmeritz/pycon-sweden-2015
refs/heads/master
/routes.py
# urls.py from django.conf.urls import include, patterns urlpatterns = patterns( '', (r'^jobs/', include("skill_and_love.job.urls")), ) # job/urls.py from django.conf.urls import url, patterns from .views import CreateJobView urlpatterns = patterns( '', url(r'^create/$', CreateJobView.as_view(), ...
{"/forms.py": ["/models.py"], "/routes.py": ["/views.py"]}
56,182
rmeritz/pycon-sweden-2015
refs/heads/master
/view.py
# templates/base/form.html <form action="{% url create_job %}" method="post"> {% csrf_token %} {{ form.non_field_errors }} <div class="form-inputs"> {{ form.as_p }} </div> <div class="form-actions"> <input type="submit" value="Submit"> </div> </form>
{"/forms.py": ["/models.py"], "/routes.py": ["/views.py"]}
56,183
rmeritz/pycon-sweden-2015
refs/heads/master
/controller.py
#job/views.py from django.views.generic import CreateView from .models import Job from .forms import CreateJobForm class JobCreateView(CreateView): model = Job form_class = CreateJobForm # django/django/blob/1.7/django/views/generic/edit.py class CreateView ... def post(self, request, *args, **kwa...
{"/forms.py": ["/models.py"], "/routes.py": ["/views.py"]}
56,192
AntonShpakovych/homework_5_PYTHON_files
refs/heads/main
/module_class.py
from datetime import datetime import os import requests succes_file = open('file_log/access.log', "a") error_file = open('file_log/error.log', "a") class GetInfo: def __init__(self, url): self.url = url def show_object(self): try: URL = self.url response = requests.ge...
{"/app.py": ["/module_class.py", "/module.py"]}
56,193
AntonShpakovych/homework_5_PYTHON_files
refs/heads/main
/app.py
from module_class import GetInfo from module import * data = {} data['exchangeRate'] = [] data['exchangeRate'].append({ 'baseCurrency': 'UAH', 'currency': 'USD', 'saleRateNB': 27.0275, 'purchaseRateNB': 27.0275, 'saleRate': 27.18, 'purchaseRate': 26.75 }) data['exchangeRate'].append({ 'base...
{"/app.py": ["/module_class.py", "/module.py"]}
56,194
AntonShpakovych/homework_5_PYTHON_files
refs/heads/main
/module.py
import json import csv from os import path, sep from openpyxl import Workbook from openpyxl import load_workbook """Module with func""" # -------JSON------------------ def write_json(path_file, data): with open(path_file, 'w') as outfile: json.dump(data, outfile, indent=4, sort_keys=True, ensure_ascii=T...
{"/app.py": ["/module_class.py", "/module.py"]}
56,195
rebelopsio/apiMacroCalc
refs/heads/main
/calculations.py
from collections import namedtuple class Calculations: @staticmethod def basal_metabolic_rate(sex: str, age: int, height_inches: int, weight: int) -> float: bmr = 0.0 if sex.upper() == "MALE": bmr = (10 * (weight / 2.2)) + (6.25 * (height_inches * 2.54) ...
{"/api.py": ["/results.py", "/calculations.py"]}
56,196
rebelopsio/apiMacroCalc
refs/heads/main
/results.py
from datetime import datetime from json import JSONEncoder class SetMacros: def __init__(self, calories=0, protein=0, carbs=0, fats=0) -> None: self._calories = calories self._protein = protein self._carbs = carbs self._fats = fats def get_calories(self) -> int: return...
{"/api.py": ["/results.py", "/calculations.py"]}
56,197
rebelopsio/apiMacroCalc
refs/heads/main
/api.py
from flask import Flask, jsonify from flask_restful import Resource, Api, reqparse from results import ResultsEncoder, Results from calculations import Calculations import json app = Flask(__name__) api = Api(app) parser = reqparse.RequestParser() parser.add_argument('sex', type=str) parser.add_argument('weight', typ...
{"/api.py": ["/results.py", "/calculations.py"]}
56,198
rebelopsio/apiMacroCalc
refs/heads/main
/test/results_tests.py
import results def
{"/api.py": ["/results.py", "/calculations.py"]}
56,213
sarveshggn/portfolio
refs/heads/master
/dsproj/apps.py
from django.apps import AppConfig class DsprojConfig(AppConfig): name = 'dsproj'
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,214
sarveshggn/portfolio
refs/heads/master
/dsproj/migrations/0003_auto_20200725_2009.py
# Generated by Django 2.2.4 on 2020-07-25 14:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dsproj', '0002_dsproject_github_link'), ] operations = [ migrations.AlterField( model_name='dsproject', name='github...
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,215
sarveshggn/portfolio
refs/heads/master
/dsproj/admin.py
from django.contrib import admin from .models import Dsproject # Register your models here. admin.site.register(Dsproject)
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,216
sarveshggn/portfolio
refs/heads/master
/jobs/migrations/0004_auto_20200725_2009.py
# Generated by Django 2.2.4 on 2020-07-25 14:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jobs', '0003_job_github_link'), ] operations = [ migrations.AlterField( model_name='job', name='github_link', ...
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,217
sarveshggn/portfolio
refs/heads/master
/pyproj/models.py
from django.db import models # Create your models here. class Pyproject(models.Model): image = models.ImageField(upload_to='image/') summary = models.CharField(max_length=255) github_link = models.CharField(max_length=300, default='#') def __str__(self): return self.summary
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,218
sarveshggn/portfolio
refs/heads/master
/dsproj/views.py
from django.shortcuts import render from .models import Dsproject # Create your views here. def dspro(request): dsprojects = Dsproject.objects return render(request, 'dsproj/dsprojhome.html', {'dsprojects': dsprojects})
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,219
sarveshggn/portfolio
refs/heads/master
/pyproj/views.py
from django.shortcuts import render from .models import Pyproject # Create your views here. def pypro(request): pyprojects = Pyproject.objects return render(request, 'pyproj/pyprojhome.html', {'pyprojects': pyprojects})
{"/pyproj/views.py": ["/pyproj/models.py"]}
56,222
scorpionhiccup/CarNet
refs/heads/master
/carnet_webserver/RestServices/models.py
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import AbstractBaseUser class traffic_data(models.Model): """docstring for traffic_data""" car_no=models.CharField(max_length=200, default="") signal_no=models.IntegerField(default=100) objects=models.Manager() #...
{"/carnet_webserver/RestServices/admin.py": ["/carnet_webserver/RestServices/models.py"], "/carnet_webserver/RestServices/views.py": ["/carnet_webserver/RestServices/models.py"]}
56,223
scorpionhiccup/CarNet
refs/heads/master
/carnet_webserver/RestServices/admin.py
from django.contrib import admin from .models import traffic_data # Register your models here. admin.site.register(traffic_data)
{"/carnet_webserver/RestServices/admin.py": ["/carnet_webserver/RestServices/models.py"], "/carnet_webserver/RestServices/views.py": ["/carnet_webserver/RestServices/models.py"]}
56,224
scorpionhiccup/CarNet
refs/heads/master
/carnet_webserver/RestServices/urls.py
from django.conf.urls import include, url, patterns from django.conf.urls.static import static from django.conf import settings urlpatterns = [ url(r'^postInfo/(?P<signal_no>\d+)/(?P<car_no>[-\w]{0,50})/$', 'RestServices.views.postInfo'), url(r'^getInfo/(?P<signal_no>\d+)/$', 'RestServices.views.getInfo'...
{"/carnet_webserver/RestServices/admin.py": ["/carnet_webserver/RestServices/models.py"], "/carnet_webserver/RestServices/views.py": ["/carnet_webserver/RestServices/models.py"]}
56,225
scorpionhiccup/CarNet
refs/heads/master
/carnet_webserver/RestServices/views.py
from django.shortcuts import render from django.http import HttpResponse, JsonResponse from .models import traffic_data from django.shortcuts import render_to_response from django.template import RequestContext def postInfo(request, signal_no, car_no): str= "Received: " + signal_no + " : " + car_no + " " new_entry=t...
{"/carnet_webserver/RestServices/admin.py": ["/carnet_webserver/RestServices/models.py"], "/carnet_webserver/RestServices/views.py": ["/carnet_webserver/RestServices/models.py"]}
56,276
cramos1567/GitHubApi567
refs/heads/master
/GitRepo.py
import requests import json def getUserCommits(userID): if not isinstance(userID,str): return "InvalidInput" if userID == "": return "InvalidInput" theStr = "User: " + userID + '\n' getRepos = requests.get("https://api.github.com/users/" + userID + "/repos") print(str(getRepo...
{"/TestGitRepo.py": ["/GitRepo.py"]}
56,277
cramos1567/GitHubApi567
refs/heads/master
/TestGitRepo.py
import unittest from GitRepo import getUserCommits class testAPI(unittest.TestCase): def test_inputType(self): self.assertEqual(getUserCommits(12), "InvalidInput") self.assertNotEqual(getUserCommits("cramos1567"), "InvalidInput") self.assertEqual(getUserCommits(""), "InvalidInput") de...
{"/TestGitRepo.py": ["/GitRepo.py"]}
56,278
saltant-org/saltant
refs/heads/master
/tasksapi/tests/execution_tests/executable_execution_tests.py
"""Contains executable task tests for the tasksapi. These test (unlike the other tests as of 2018-08-27) are *very* basic and should be expanded in the future. """ import os import pathlib import shutil import subprocess import uuid from django.conf import settings from django.test import TestCase from tasksapi.tasks...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,279
saltant-org/saltant
refs/heads/master
/tasksapi/utils.py
"""Helpful functions for the tasksapi.""" from django.db.models import Case, IntegerField, Q, When from tasksapi.constants import DOCKER from tasksapi.models import ExecutableTaskType, TaskQueue def get_allowed_queues(user, task_type=None): """Return queryset of the allowed queues. This is with respect to t...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,280
saltant-org/saltant
refs/heads/master
/tasksapi/migrations/0004_user_time_zone.py
# Generated by Django 2.1.2 on 2018-12-05 06:27 from django.db import migrations import timezone_field.fields class Migration(migrations.Migration): dependencies = [ ('tasksapi', '0003_auto_20181204_2211'), ] operations = [ migrations.AddField( model_name='user', ...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,281
saltant-org/saltant
refs/heads/master
/frontend/views/taskinstances.py
"""Views for task instances. Views for creating and cloning are in a separate module. """ from celery.result import AsyncResult from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect from django.urls import reverse_lazy from django.views.generic import DeleteView, Detai...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,282
saltant-org/saltant
refs/heads/master
/tasksapi/migrations/0005_auto_20181211_1415.py
# Generated by Django 2.1.2 on 2018-12-11 22:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasksapi', '0004_user_time_zone'), ] operations = [ migrations.AddField( model_name='taskqueue', name='runs_docker_c...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,283
saltant-org/saltant
refs/heads/master
/tasksapi/admin.py
"""Register models with the admin site.""" from django.contrib import admin from django.contrib.auth.admin import UserAdmin from tasksapi.models import ( ContainerTaskInstance, ContainerTaskType, ExecutableTaskInstance, ExecutableTaskType, TaskQueue, TaskWhitelist, User, ) @admin.register...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,284
saltant-org/saltant
refs/heads/master
/tasksapi/tests/requests_tests/user_queue_permissions_requests_tests.py
"""Contains requests tests for user queue permissions.""" from rest_framework import status from rest_framework.test import APITestCase # Put info about our fixtures data as constants here NON_ADMIN_USER_AUTH_TOKEN = "02d205bc79d5e8f15f83e249ac227ef0085f953f" NOT_USERS_PRIVATE_QUEUE_PK = 3 PUBLIC_INACTIVE_QUEUE_PK = ...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,285
saltant-org/saltant
refs/heads/master
/frontend/views/utils.py
"""Contains general helpers for frontend views.""" from datetime import date, timedelta import json from .utils_stats import determine_days_to_plot, get_job_state_data def translate_num_days_to_plot_title(num_days): """Translate a date range to a plot title. Args: num_days: An integer specifying how...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,286
saltant-org/saltant
refs/heads/master
/tasksapi/permissions.py
"""Contains permissions for the API.""" from rest_framework import permissions class IsAdminOrOwnerThenWriteElseReadOnly(permissions.IsAuthenticated): """Allow editing objects only for admin or associated object user. Inherits from the IsAuthenticated permission, which is the default saltant permission ...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,287
saltant-org/saltant
refs/heads/master
/tasksapi/constants.py
"""Constants for the tasksapi app.""" # Choices for the task instance's state field. The states are based off # of signals provided by Celery (which in fact set the state field): # http://docs.celeryproject.org/en/master/userguide/signals.html. CREATED = "created" PUBLISHED = "published" RUNNING = "running" SUCCESSFUL...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,288
saltant-org/saltant
refs/heads/master
/tasksapi/urls.py
"""Contains URLs for the tasksapi app.""" from django.urls import include, path, re_path from drf_yasg import openapi from drf_yasg.views import get_schema_view from rest_framework import permissions from rest_framework.routers import DefaultRouter from tasksapi import views # A router to register Django REST Framew...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,289
saltant-org/saltant
refs/heads/master
/saltant/settings.py
""" Django settings for saltant project. There are two parts to this file. The first part deals with settings that both Django and Celery workers need to worry about. The second part deals with settings that only Django needs to worry about. Generated by 'django-admin startproject' using Django 2.0.6. For more infor...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,290
saltant-org/saltant
refs/heads/master
/frontend/tests.py
"""Contains tests for the front-end.""" from django.test import TestCase from django.urls import reverse from rest_framework import status ADMIN_USER_USERNAME = "adminuser" ADMIN_USER_PASSWORD = "qwertyuiop" EXECUTABLE_TASK_INSTANCE_UUID = "aa07248f-fdf3-4d34-8215-0c7b21b892ad" CONTAINER_TASK_INSTANCE_UUID = "e713397...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,291
saltant-org/saltant
refs/heads/master
/tasksapi/serializers/task_instance_update.py
"""Contains a serializer to update any task instance state. Emphasis on "any". This works for both container *and* executable tasks. """ from rest_framework import serializers from tasksapi.constants import STATE_CHOICES class TaskInstanceStateUpdateRequestSerializer(serializers.Serializer): """A serializer for...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,292
saltant-org/saltant
refs/heads/master
/tasksapi/serializers/users.py
"""Contains serializers for users.""" from rest_framework import serializers from tasksapi.models import User class UserSerializer(serializers.ModelSerializer): """A serializer for a user, without password details.""" class Meta: model = User lookup_field = "username" fields = ("user...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,293
saltant-org/saltant
refs/heads/master
/tasksapi/tests/execution_tests/container_execution_tests.py
"""Contains container task tests for the tasksapi.""" import os import pathlib import subprocess import uuid import docker from django.conf import settings from django.test import TestCase from tasksapi.tasks import ( run_docker_container_command, run_singularity_container_command, ) class ContainerExecution...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,294
saltant-org/saltant
refs/heads/master
/frontend/views/whitelists.py
"""Views for task whitelists.""" from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.views.generic import ( CreateView, DeleteView, DetailView, ListView, UpdateView, ) from tasksapi.models import TaskWhitelist from .mixins import ( DisableU...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,295
saltant-org/saltant
refs/heads/master
/frontend/views/utils_stats.py
"""Contains helpers for getting and packaging data statistics.""" from datetime import date, timedelta from frontend.constants import ( DATES_LIST, DEFAULT_DAYS_TO_PLOT, INTERESTING_STATES, STATE_COLOR_DICT, ) from tasksapi.constants import CONTAINER_TASK, CREATED from tasksapi.models import ContainerT...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,296
saltant-org/saltant
refs/heads/master
/tasksapi/tests/requests_tests/utils.py
"""Contains helpers for requests tests.""" from tasksapi.constants import DOCKER TEST_CONTAINER_TASK_TYPE_DICT = dict( name="my-task-type", description="Fantastic task type", container_image="mwiens91/hello-world", container_type=DOCKER, command_to_run="/app/hello_world.py", logs_path="/logs/...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,297
saltant-org/saltant
refs/heads/master
/frontend/widgets.py
"""Custom widgets for forms.""" from django import forms from django.template.loader import render_to_string from django.utils.safestring import mark_safe class JSONEditorWidget(forms.Widget): """A JSONField widget using JSONEditor. See https://github.com/josdejong/jsoneditor. Note that this code is mos...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,298
saltant-org/saltant
refs/heads/master
/tasksapi/tests/models_tests/queue_whitelist_tests.py
"""Contains tests for queue whitelists.""" from django.core.exceptions import ValidationError from django.test import TestCase from tasksapi.models import ( ContainerTaskInstance, ContainerTaskType, ExecutableTaskInstance, ExecutableTaskType, TaskQueue, User, ) # Put info about our fixtures d...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,299
saltant-org/saltant
refs/heads/master
/tasksapi/tests/models_tests/queue_permission_attrs_tests.py
"""Contains tests for queue permission attributes.""" from django.core.exceptions import ValidationError from django.test import TestCase from tasksapi.models import ( ContainerTaskInstance, ContainerTaskType, ExecutableTaskInstance, ExecutableTaskType, TaskQueue, User, ) # Put info about our...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,300
saltant-org/saltant
refs/heads/master
/tasksapi/tasks/utils.py
"""Contains utility functions for tasks.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import errno import os import sys def create_local_directory(path): """Create a local directory as in mkdir_p. Replace this function with os.makedirs(path,...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,301
saltant-org/saltant
refs/heads/master
/tasksapi/models/utils.py
"""Common bits of code used by model files.""" from django.core.validators import RegexValidator from tasksapi.constants import CONTAINER_TASK, EXECUTABLE_TASK # RegexValidator for validating a names. sane_name_validator = RegexValidator( regex=r"^[\w@+-]+$", message=" @/+/-/_ only" ) def determine_task_class(...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,302
saltant-org/saltant
refs/heads/master
/tasksapi/filters.py
"""Contains filters to go along with viewsets for the REST API.""" from django_filters import rest_framework as filters from tasksapi.models import ( ContainerTaskInstance, ContainerTaskType, ExecutableTaskInstance, ExecutableTaskType, TaskQueue, TaskWhitelist, User, ) # Common lookups for...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,303
saltant-org/saltant
refs/heads/master
/frontend/templatetags/jsonify.py
"""Filter to provide JSON dump transforms.""" import json from django.template import Library register = Library() @register.filter(is_safe=True) def jsonify(val): """Perform a naive JSON dump.""" return json.dumps(val)
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,304
saltant-org/saltant
refs/heads/master
/frontend/views/errors.py
"""Views for error pages.""" from django.views.generic import TemplateView class BadRequest400(TemplateView): """A 400 page.""" template_name = "frontend/400.html" def get(self, request, *args, **kwargs): """Show the 400 page.""" return self.render_to_response( self.get_cont...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,305
saltant-org/saltant
refs/heads/master
/tasksapi/models/task_queues.py
"""Model to represent task queues.""" from django.db import models from .users import User from .utils import sane_name_validator class TaskWhitelist(models.Model): """A whitelist of tasks for queues to run.""" name = models.CharField( max_length=50, unique=True, help_text="The name of the whitelist...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,306
saltant-org/saltant
refs/heads/master
/tasksapi/tasks/__init__.py
"""Collect import task code to "export" from this directory.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from .base_task import run_task from .container_tasks import ( run_docker_container_command, run_singularity_container_command, ) from .ex...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,307
saltant-org/saltant
refs/heads/master
/frontend/templatetags/fontawesomize.py
"""Filter to convert booleans to icons.""" import json from django.template import Library register = Library() @register.filter(is_safe=True) def fontawesomize(val): """Convert boolean to font awesome icon.""" if val: return '<i class="fa fa-check" style="color: green"></i>' return '<i class=...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,308
saltant-org/saltant
refs/heads/master
/tasksapi/tests/requests_tests/basic_requests_tests.py
"""Contains tests for basic API requests.""" from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.test import APITransactionTestCase from tasksapi.constants import PUBLISHED from tasksapi.models import User from .utils import ( TEST_CONTAINER_TASK_TYPE_DICT, T...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...
56,309
saltant-org/saltant
refs/heads/master
/tasksapi/models/container_tasks.py
"""Models to represent task types and instances which use containers.""" from django.db import models from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.utils import timezone from tasksapi.constants import ( SUCCESSFUL, FAILED, CONTAINER_CHOICES, C...
{"/tasksapi/tests/execution_tests/executable_execution_tests.py": ["/tasksapi/tasks/__init__.py"], "/tasksapi/utils.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py"], "/frontend/views/taskinstances.py": ["/tasksapi/constants.py", "/tasksapi/models/__init__.py", "/frontend/views/mixins.py", "/frontend/view...