index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
42,766 | Steve-XD/qkan100-compsci235-a2 | refs/heads/main | /Tests/e2e/test_web_app.py | import pytest
from flask import session
def test_register(client):
# Check that we retrieve the register page.
response_code = client.get('/authentication/register').status_code
assert response_code == 200
# Check that we can register a user successfully, supplying a valid username and pas... | {"/CS235Flix/adapters/memory_repository.py": ["/CS235Flix/adapters/repository.py", "/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_movie.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_review.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_actor.py": ... |
42,767 | Steve-XD/qkan100-compsci235-a2 | refs/heads/main | /Tests/unit/test_domain_model/test_watchlist.py | from CS235Flix.domain.model import WatchList, Movie
import pytest
@pytest.fixture()
def watchlist():
return WatchList()
def test_cr3(watchlist):
watchlist = WatchList()
print(f"Size of watchlist: {watchlist.size()}")
watchlist.add_movie(Movie("Moana", 2016))
watchlist.add_movie(Movie(... | {"/CS235Flix/adapters/memory_repository.py": ["/CS235Flix/adapters/repository.py", "/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_movie.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_review.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_actor.py": ... |
42,768 | Steve-XD/qkan100-compsci235-a2 | refs/heads/main | /Tests/unit/test_domain_model/test_user.py | from CS235Flix.domain.model import Movie, Review, User
import datetime
import pytest
@pytest.fixture()
def user():
return User("","")
def test_init(user):
#test cr3
user1 = User('Martin', 'pw12345')
user2 = User('Ian', 'pw67890')
user3 = User('Daniel', 'pw87465')
assert repr(user1... | {"/CS235Flix/adapters/memory_repository.py": ["/CS235Flix/adapters/repository.py", "/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_movie.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_review.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_actor.py": ... |
42,769 | Steve-XD/qkan100-compsci235-a2 | refs/heads/main | /CS235Flix/movies/movies.py | from datetime import datetime
from flask import Blueprint
from flask import request, render_template, redirect, url_for, session
from better_profanity import profanity
from flask_wtf import FlaskForm
from wtforms import TextAreaField, HiddenField, SubmitField, SelectField, StringField
from wtforms.validators ... | {"/CS235Flix/adapters/memory_repository.py": ["/CS235Flix/adapters/repository.py", "/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_movie.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_review.py": ["/CS235Flix/domain/model.py"], "/Tests/unit/test_domain_model/test_actor.py": ... |
42,775 | v-nys/xchk-css-content | refs/heads/master | /xchk_css_content/contentviews.py | from xchk_core.contentviews import ContentView
from xchk_core.strats import *
class PageFooterView(ContentView):
uid = 'css_page_footer'
template = 'xchk_css_content/css_page_footer.html'
strat = Strategy(refusing_check=TrueCheck(),
accepting_check=Negation(TrueCheck()))
| {"/xchk_css_content/course.py": ["/xchk_css_content/contentviews.py"]} |
42,776 | v-nys/xchk-css-content | refs/heads/master | /xchk_css_content/course.py | from xchk_core import contentviews as basecv
from xchk_core.courses import Course
from .contentviews import *
course = Course('css',
'CSS',
[(PageFooterView,[])])
| {"/xchk_css_content/course.py": ["/xchk_css_content/contentviews.py"]} |
42,777 | v-nys/xchk-css-content | refs/heads/master | /xchk_css_content/apps.py | from django.apps import AppConfig
class CSScontentConfig(AppConfig):
name = 'xchk_css_content'
| {"/xchk_css_content/course.py": ["/xchk_css_content/contentviews.py"]} |
42,778 | zaebumbatt/Appointment-Service | refs/heads/main | /appointments/admin.py | from django.contrib import admin
from .models import Appointment, Doctor
class AppointmentAdmin(admin.ModelAdmin):
list_display = ('date', 'time', 'doctor', 'patient')
list_filter = ('date', 'doctor')
search_fields = ('date', 'doctor')
class DoctorAdmin(admin.ModelAdmin):
pass
admin.site.register... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,779 | zaebumbatt/Appointment-Service | refs/heads/main | /appointments/forms.py | from django import forms
from .models import TIME_CHOICES, Appointment, Doctor
class AppointmentForm(forms.Form):
first_name = forms.CharField(
label='First Name',
max_length=150,
widget=forms.TextInput(attrs={
'class': 'form-control',
'placeholder': 'First Name'
... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,780 | zaebumbatt/Appointment-Service | refs/heads/main | /appointments/models.py | from datetime import date, datetime, time
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator
from django.db import models
User = get_user_model()
TIME_CHOICES = [
('', 'Choose Time'),
(time(9, 00), '09:00'),
... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,781 | zaebumbatt/Appointment-Service | refs/heads/main | /appointments/management/commands/create_test_data.py | from django.core.management.base import BaseCommand
from appointments.models import User, Doctor
class Command(BaseCommand):
help = 'Creates test data'
def handle(self, *args, **options):
User.objects.create_superuser(
username='admin',
password='admin'
)
User... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,782 | zaebumbatt/Appointment-Service | refs/heads/main | /appointments/views.py | import json
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from .forms import AppointmentForm
from .models import Appointment, User
@login_required
def index(request):
username = request.user.usernam... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,783 | zaebumbatt/Appointment-Service | refs/heads/main | /appointments/tests.py | from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from .forms import AppointmentForm
from .models import User, Doctor, Appointment
import datetime
class AppointmentTestCase(TestCase):
def setUp(self):
self.patient = User.objects.creat... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,784 | zaebumbatt/Appointment-Service | refs/heads/main | /users/views.py | import json
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, redirect, render
from appointments.models import Appointment, User
from .forms import SignUp
def signup(request):
if request.method == 'POST':
form = SignUp(request.POST)
if for... | {"/appointments/admin.py": ["/appointments/models.py"], "/appointments/forms.py": ["/appointments/models.py"], "/appointments/management/commands/create_test_data.py": ["/appointments/models.py"], "/appointments/views.py": ["/appointments/forms.py", "/appointments/models.py"], "/appointments/tests.py": ["/appointments/... |
42,785 | mbj417/PLA | refs/heads/master | /osm_pla/server/server.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
##
# Copyright 2019 ArctosLabs Scandinavia AB
#
# 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.... | {"/osm_pla/server/server.py": ["/osm_pla/placement/mznplacement.py"], "/osm_pla/cmd/pla_server.py": ["/osm_pla/server/server.py"]} |
42,786 | mbj417/PLA | refs/heads/master | /osm_pla/cmd/pla_server.py | # -*- coding: utf-8 -*-
# Copyright 2019 ArctosLabs Scandinavia AB
# *************************************************************
# This file is part of OSM Placement module
# All Rights Reserved to ArctosLabs Scandinavia AB
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this fi... | {"/osm_pla/server/server.py": ["/osm_pla/placement/mznplacement.py"], "/osm_pla/cmd/pla_server.py": ["/osm_pla/server/server.py"]} |
42,787 | mbj417/PLA | refs/heads/master | /osm_pla/placement/mznplacement.py | '''
Created on 30 aug. 2019
@author: LG
'''
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
import yaml
from pathlib import Path
import pymzn
import re
import platform
from _collections import OrderedDict
import pkg_resources
import os
import json
dummy_model = '''
... | {"/osm_pla/server/server.py": ["/osm_pla/placement/mznplacement.py"], "/osm_pla/cmd/pla_server.py": ["/osm_pla/server/server.py"]} |
42,807 | Imprasna/WoTrack | refs/heads/master | /apps/wordtrack/levenshtein_reduce.py | from nltk import metrics
class LevenshteinReduce(object):
def __init__(self, phrase, tracks):
"""
:param phrase: (str) phrase or ngram
:param tracks: (list) tacks to perform best string matching with
:return: Returns the track from the list of tracks best matching the given phrase... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,808 | Imprasna/WoTrack | refs/heads/master | /tasks.py | import sys
from invoke import task as invoke_task, run
use_pty = sys.stdin.isatty()
@invoke_task
def tests():
print 'Running Spotify Client tests...'
run('cd packages/spotify/spotify; time nosetests --rednose --nologcapture tests', pty=use_pty)
print 'Running Application tests...'
run('time nosetest... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,809 | Imprasna/WoTrack | refs/heads/master | /packages/spotify/spotify/utils/cache.py | import pylibmc
class Cache(object):
_memcached = None
@classmethod
def memcached_handle(cls):
"""
:return: the Singleton handle to the memcache server
"""
if not cls._memcached:
try:
cls._memcached = pylibmc.Client(
["127.0.0... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,810 | Imprasna/WoTrack | refs/heads/master | /apps/wordtrack/urls.py | from django.conf.urls import url
from apps.wordtrack.views import WordTrackView
urlpatterns = [
url(r'^$', WordTrackView.as_view(), name='home'),
]
| {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,811 | Imprasna/WoTrack | refs/heads/master | /apps/wordtrack/views.py | from django.http import JsonResponse
from django.shortcuts import render
from django.views.generic import View
from apps.wordtrack.form import WordTrackForm
from apps.wordtrack.lyrics_track import LyricsTrack
class WordTrackView(View):
def get(self, request):
view_data = {
'tracks': [],
... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,812 | Imprasna/WoTrack | refs/heads/master | /packages/spotify/setup.py | from setuptools import setup
setup(
name='spotify',
version='0.0.1',
description='RESTFUL client for Spotify',
url='http://github.com/husman/wotrack',
author='Haleeq Usman',
author_email='cusman1987@gmail.com',
license='MIT',
packages=['spotify'],
install_requires=[
'request... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,813 | Imprasna/WoTrack | refs/heads/master | /apps/wordtrack/form.py | from django import forms
class WordTrackForm(forms.Form):
lyrics = forms.CharField(
widget=forms.Textarea(
attrs={'placeholder': 'Please enter your text...'}
),
required=True,
label='Your Lyrics'
) | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,814 | Imprasna/WoTrack | refs/heads/master | /apps/wordtrack/lyrics_track.py | import string
import nltk
from nltk.collocations import *
from nltk.tokenize import word_tokenize
from apps.wordtrack.levenshtein_reduce import LevenshteinReduce
from spotify.utils.spotify_client import SpotifyClient
class LyricsTrack(object):
def __init__(self, lyrics):
"""
Converts the input lyr... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,815 | Imprasna/WoTrack | refs/heads/master | /packages/spotify/spotify/tests/integration/utils/test_cache.py | from hamcrest import assert_that, not_none, none, has_entries
from spotify.utils.cache import Cache
class TestCache(object):
def test_can_connect_to_server_successfully(self):
memcached = Cache.memcached_handle()
assert_that(memcached, not_none())
def test_get_object_not_in_cache_returns_not... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,816 | Imprasna/WoTrack | refs/heads/master | /packages/spotify/spotify/tests/integration/__init__.py | from spotify.utils.cache import Cache
class IntegrationTestCase(object):
def setUp(self):
Cache.clear()
def tearDown(self):
Cache.clear() | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,817 | Imprasna/WoTrack | refs/heads/master | /packages/spotify/spotify/utils/spotify_client.py | import json
import requests
from spotify.utils.cache import Cache
class SpotifyClient(object):
def format_track_response(self, response_data):
"""
:param response_data: dictionary formatted response data received from Spotify
:return tracks : (list) formatted track data with the name, arti... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,818 | Imprasna/WoTrack | refs/heads/master | /tests/apps/wordtrack/test_lyrics_track.py | from hamcrest import assert_that, empty, not_
from apps.wordtrack.lyrics_track import LyricsTrack
from spotify.tests.integration import IntegrationTestCase
class TestLyricsTrack(IntegrationTestCase):
def test_get_greatest_pmi_collocation_ngrams(self):
lyrics_track = LyricsTrack(
"The red ball ... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,819 | Imprasna/WoTrack | refs/heads/master | /packages/spotify/spotify/tests/integration/utils/test_spotify_client.py | from hamcrest import assert_that, equal_to, not_none, has_entries, contains, contains_inanyorder
from packages.spotify.spotify.utils.spotify_client import SpotifyClient
from spotify.tests.integration import IntegrationTestCase
from spotify.utils.cache import Cache
class TestSpotifyClient(IntegrationTestCase):
def... | {"/apps/wordtrack/urls.py": ["/apps/wordtrack/views.py"], "/apps/wordtrack/views.py": ["/apps/wordtrack/form.py", "/apps/wordtrack/lyrics_track.py"], "/apps/wordtrack/lyrics_track.py": ["/apps/wordtrack/levenshtein_reduce.py"], "/tests/apps/wordtrack/test_lyrics_track.py": ["/apps/wordtrack/lyrics_track.py"], "/package... |
42,821 | akselreiten/digiform-api | refs/heads/master | /subjects/urls.py | from django.conf.urls import url
from .views import SubjectListCreateView,SubjectCreateView
urlpatterns = [
#creating view of all subjects
url(r'^$',
SubjectListCreateView.as_view(),
name='subject-list-create'),
#a pk from 0 to 9 is sent with the url,
#defining the subject id.
... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,822 | akselreiten/digiform-api | refs/heads/master | /subjects/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class Subject(models.Model):
#university lecturing the subject
university = models.ForeignKey("universities.University", on_delete=models.CASCADE)
#subject title
title = models.CharField(... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,823 | akselreiten/digiform-api | refs/heads/master | /application/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
# Create your models here.
class Application(models.Model):
STATUS_PROCESSING = "Processing" #application being processed
STATUS_ACCEPTED = "Accepted" #application approved
STA... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,824 | akselreiten/digiform-api | refs/heads/master | /application/migrations/0004_auto_20170312_1551.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-12 15:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0003_application_application_status'),
]
operations = [
migr... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,825 | akselreiten/digiform-api | refs/heads/master | /digiform_api/utils/test_mixins.py | import json
from django.db.models.signals import post_save
from django.utils.crypto import get_random_string
from rest_framework.test import APITestCase
from rest_framework_jwt.settings import api_settings
#test methods used throughout the test functions
jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER
jwt_enc... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,826 | akselreiten/digiform-api | refs/heads/master | /user_messages/views.py | from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from itertools import chain
from operator import attrgetter
from django.db.models import Q
from .mo... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,827 | akselreiten/digiform-api | refs/heads/master | /digiform_api/utils/test_factory.py | from django.contrib.auth.models import User
from universities.models import University
from subjects.models import Subject
from test_mixins import random_string, get_random_email
import uuid
def create_user(): #test user
id = str(uuid.uuid4())
return User.objects.create(username=id,
... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,828 | akselreiten/digiform-api | refs/heads/master | /university_reviews/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
# Create your models here.
class UniversityReview(models.Model):
#user from foreign key
user = models.Forei... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,829 | akselreiten/digiform-api | refs/heads/master | /university_reviews/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-25 10:11
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dep... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,830 | akselreiten/digiform-api | refs/heads/master | /users/serializers.py | import serpy
from django.contrib.auth import get_user_model
from rest_framework import serializers
from django.contrib.auth.models import User
class UserSerializer(serpy.Serializer):
#user id
id = serpy.IntField()
#username
username = serpy.StrField()
#user email
email = serpy.StrField()
... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,831 | akselreiten/digiform-api | refs/heads/master | /subjects/serializers.py | import serpy
from rest_framework import serializers
from .models import Subject
#serialzier for getting subjects
class SubjectSerializer(serializers.ModelSerializer):
class Meta:
depth = 2 #for filtering purposes
model = Subject
fields = '__all__'
#serializer for creating subjects
class... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,832 | akselreiten/digiform-api | refs/heads/master | /user_messages/urls.py | from django.conf.urls import url
from .views import MessageListView
urlpatterns = [
url(r'^$',
MessageListView.as_view(),
name='chat-list-create'),
] | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,833 | akselreiten/digiform-api | refs/heads/master | /subjects/views.py | from django.shortcuts import render
from rest_framework import generics, permissions, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Subject
from .serializers import SubjectSerializer, SubjectCreate... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,834 | akselreiten/digiform-api | refs/heads/master | /users/tests.py | from django.test import TestCase, Client
from django.test.utils import setup_test_environment
from application.models import Application
from subjects.models import Subject
from digiform_api.utils.test_mixins import ExtendedAPITestCase
from digiform_api.utils.test_factory import create_user, create_university, create_o... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,835 | akselreiten/digiform-api | refs/heads/master | /user_messages/tests.py | from django.test import TestCase, Client
from django.test.utils import setup_test_environment
from application.models import Application
from subjects.models import Subject
from digiform_api.utils.test_mixins import ExtendedAPITestCase
from digiform_api.utils.test_factory import create_user, create_university, create_o... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,836 | akselreiten/digiform-api | refs/heads/master | /subjects/tests.py | from django.test import TestCase
from digiform_api.utils.test_mixins import ExtendedAPITestCase
from digiform_api.utils.test_factory import create_user, create_university, create_foreign_subject
from django.urls import reverse
from rest_framework import status
# Create your tests here.
class CreateSubjectTest(Extende... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,837 | akselreiten/digiform-api | refs/heads/master | /universities/migrations/0002_auto_20170303_1839.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-03 18:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('universities', '0001_initial'),
]
operations = [
migrations.AddField(
... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,838 | akselreiten/digiform-api | refs/heads/master | /universities/serializers.py | import serpy
from rest_framework import serializers
from .models import University
#university serializer
class UniversitySerializer(serializers.ModelSerializer):
class Meta:
model = University
fields = '__all__'
| {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,839 | akselreiten/digiform-api | refs/heads/master | /users/views.py | from django.shortcuts import render
from rest_framework.decorators import api_view, permission_classes
from rest_framework import permissions, status
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.authentic... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,840 | akselreiten/digiform-api | refs/heads/master | /university_reviews/urls.py | from django.conf.urls import url
from .views import UniversityReviewListCreateView
urlpatterns = [
#get and create review
url(r'^$',
UniversityReviewListCreateView.as_view(),
name='university-review-list-create')
]
| {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,841 | akselreiten/digiform-api | refs/heads/master | /university_reviews/tests.py | from django.test import TestCase, Client
from django.test.utils import setup_test_environment
from digiform_api.utils.test_mixins import ExtendedAPITestCase
from digiform_api.utils.test_factory import create_user, create_university
from django.urls import reverse
from universities.models import University
from rest_fra... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,842 | akselreiten/digiform-api | refs/heads/master | /application/serializers.py | import serpy
from django.contrib.auth import get_user_model
from rest_framework import serializers
from .models import Application
#serializer for getting own applications
class ApplicationSerializer(serializers.ModelSerializer):
class Meta:
depth = 2 #allows foreign key accessing
model = Applic... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,843 | akselreiten/digiform-api | refs/heads/master | /application/migrations/0002_auto_20170312_1339.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-12 13:39
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('subjects', '0005_auto_2017... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,844 | akselreiten/digiform-api | refs/heads/master | /application/views.py | from django.shortcuts import render
from rest_framework import generics, permissions, status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from .models impor... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,845 | akselreiten/digiform-api | refs/heads/master | /universities/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class University(models.Model):
#university name
title = models.CharField(
_('title'),
max_length=255
)
#unviersity country
country = models.CharField(
_('countr... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,846 | akselreiten/digiform-api | refs/heads/master | /application/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-04 01:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('subjec... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,847 | akselreiten/digiform-api | refs/heads/master | /users/models.py | from django.db import models
from django.contrib.auth.models import User
#using a standard model from django library | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,848 | akselreiten/digiform-api | refs/heads/master | /subjects/migrations/0004_subject_coursecode.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-04 01:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subjects', '0003_subject_university'),
]
operations = [
migrations.AddField... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,849 | akselreiten/digiform-api | refs/heads/master | /application/tests.py | from django.test import TestCase, Client
from django.test.utils import setup_test_environment
from application.models import Application
from subjects.models import Subject
from digiform_api.utils.test_mixins import ExtendedAPITestCase
from digiform_api.utils.test_factory import create_user, create_foreign_subject, cre... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,850 | akselreiten/digiform-api | refs/heads/master | /application/urls.py | from django.conf.urls import url
from .views import ApplicationListCreateView, AllApplicationsListCreateView
urlpatterns = [
#creating application view of own applications
url(r'^$',
ApplicationListCreateView.as_view(),
name='application-list-create'),
#creating application view of all ... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,851 | akselreiten/digiform-api | refs/heads/master | /universities/tests.py | from django.test import TestCase, Client
from django.test.utils import setup_test_environment
from application.models import Application
from subjects.models import Subject
from digiform_api.utils.test_mixins import ExtendedAPITestCase
from digiform_api.utils.test_factory import create_user
from django.urls import reve... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,852 | akselreiten/digiform-api | refs/heads/master | /user_messages/models.py | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
class Message(models.Model):
#user sender
sender = models.ForeignKey(User, related_name="sender", on_delete=models.CASCADE)
#user recei... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,853 | akselreiten/digiform-api | refs/heads/master | /university_reviews/admin.py | from django.contrib import admin
from .models import UniversityReview
# Register your models here.
@admin.register(UniversityReview)
class ApplicationAdmin(admin.ModelAdmin):
pass | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,854 | akselreiten/digiform-api | refs/heads/master | /university_reviews/views.py | from django.shortcuts import render
from rest_framework import generics, permissions, status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from .models impor... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,855 | akselreiten/digiform-api | refs/heads/master | /university_reviews/serializers.py | import serpy
from django.contrib.auth import get_user_model
from rest_framework import serializers
from .models import UniversityReview
#get reviews
class UniversityReviewSerializer(serializers.ModelSerializer):
class Meta:
depth = 2
model = UniversityReview
fields = '__all__'
#create re... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,856 | akselreiten/digiform-api | refs/heads/master | /application/migrations/0003_application_application_status.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-12 15:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0002_auto_20170312_1339'),
]
operations = [
migrations.AddFi... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,857 | akselreiten/digiform-api | refs/heads/master | /university_reviews/apps.py | from django.apps import AppConfig
class UniversityReviewsConfig(AppConfig):
name = 'university_reviews'
| {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,858 | akselreiten/digiform-api | refs/heads/master | /universities/admin.py | from django.contrib import admin
from .models import University
# Register your models here.
@admin.register(University)
class UniversityAdmin(admin.ModelAdmin):
pass | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,859 | akselreiten/digiform-api | refs/heads/master | /universities/views.py | from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import University
from .serializers import UniversitySerializer
from subjects.models... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,860 | akselreiten/digiform-api | refs/heads/master | /subjects/migrations/0003_subject_university.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-04 01:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('universities', '0002_auto_20170303_1839'),
('subjec... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,861 | akselreiten/digiform-api | refs/heads/master | /subjects/migrations/0005_auto_20170312_1339.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-12 13:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('subjects', '0004_subject_coursecode'),
]
operation... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,862 | akselreiten/digiform-api | refs/heads/master | /universities/urls.py | from django.conf.urls import url
from .views import UniversityListCreateView, UniversityListSubjectView, UniversitySearchListCreateView
urlpatterns = [
#get all universities;create university
url(r'^$',
UniversityListCreateView.as_view(),
name='university-list-create'),
#get specific un... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,863 | akselreiten/digiform-api | refs/heads/master | /user_messages/serializers.py | import serpy
from rest_framework import serializers
from .models import Message
#get messages
class MessageSerializer(serializers.ModelSerializer):
class Meta:
model = Message
depth = 1
fields = '__all__'
#create messages
class MessageCreateSerializer(serializers.ModelSerializer):
se... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,864 | akselreiten/digiform-api | refs/heads/master | /users/urls.py | from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token, verify_jwt_token
from .views import UserListCreate, UserHandling
urlpatterns = [
#authenticate user
url(r'^api-token-auth/$',
obtain_jwt_token,
name='token-auth'),
#verify user
url(r'^api-token-v... | {"/subjects/urls.py": ["/subjects/views.py"], "/user_messages/views.py": ["/user_messages/models.py", "/user_messages/serializers.py"], "/digiform_api/utils/test_factory.py": ["/universities/models.py", "/subjects/models.py"], "/subjects/serializers.py": ["/subjects/models.py"], "/user_messages/urls.py": ["/user_messag... |
42,868 | Sparen/PMD-RTDX-DropLog | refs/heads/master | /reportgen.py | # Python 3 Report Generator
# For every item, generates a list of drop locations in HTML format
import dxutil
items = dxutil.loadItems()
dungeons = dxutil.getDungeons()
# Initialize Report File
report = open("report/report.html", "w")
report.write("<!DOCTYPE html><title>DX Drop Logs - Drop Report</title>\n")
report.... | {"/reportgen.py": ["/dxutil.py"]} |
42,869 | Sparen/PMD-RTDX-DropLog | refs/heads/master | /dxutil.py | class Item:
def __init__(self, name, dropname, category, imagename, artname):
self.name = name # Name of item, including name to put in the report
self.dropname = dropname # Name of item used in logs - often omits the ending (e.g. omits 'Orb' or 'Seed')
self.category = category # Row ID used in logs
self.image... | {"/reportgen.py": ["/dxutil.py"]} |
42,870 | lipeacelino/Projeto-LOC | refs/heads/master | /leagueofclass/cadastros/form.py | from django import forms
from .models import Professor
from .models import Aluno
from .models import Usuarios
from .models import AtividadesProfessor
class AtividadeForm():
'''
Responsavel por criar uma Atividade q esta relacionada a um Professor
Cada atividade precisa ter um Professor.
uma Atividade pode ter Div... | {"/leagueofclass/cadastros/form.py": ["/leagueofclass/cadastros/models.py"], "/leagueofclass/cadastros/views.py": ["/leagueofclass/cadastros/models.py", "/leagueofclass/cadastros/form.py"]} |
42,871 | lipeacelino/Projeto-LOC | refs/heads/master | /leagueofclass/acessos/views.py | from django.shortcuts import render
from cadastros.models import Aluno, Pessoa, Notas
def chosePerfil(request):
return render(request,'leagueofclass/telaescolha.html')
def acessoProfessor(request):
return render(request,'leagueofclass/painel_professor.html')
def acessoAluno(request):
data = {}
#idei... | {"/leagueofclass/cadastros/form.py": ["/leagueofclass/cadastros/models.py"], "/leagueofclass/cadastros/views.py": ["/leagueofclass/cadastros/models.py", "/leagueofclass/cadastros/form.py"]} |
42,872 | lipeacelino/Projeto-LOC | refs/heads/master | /leagueofclass/cadastros/models.py | from django.db import models
import datetime
# Create your models here.
# Responsavel por criar os models do cad de professor e aluno
class Pessoa(models.Model):
options_sexo=(('M','Masculino'),('F','Feminino'),('NDA','Qualquer Outro'))
nome=models.CharField(max_length=60)
sexo=models.CharField(max_length=1,cho... | {"/leagueofclass/cadastros/form.py": ["/leagueofclass/cadastros/models.py"], "/leagueofclass/cadastros/views.py": ["/leagueofclass/cadastros/models.py", "/leagueofclass/cadastros/form.py"]} |
42,873 | lipeacelino/Projeto-LOC | refs/heads/master | /leagueofclass/cadastros/views.py | from django.shortcuts import render
from .models import Aluno,Professor,Usuarios
from .form import ProfessorForm,AlunoForm;
from django.views.generic.edit import CreateView
from django.shortcuts import redirect
from django.contrib import messages
from time import sleep
from django.contrib.auth.models import User
from d... | {"/leagueofclass/cadastros/form.py": ["/leagueofclass/cadastros/models.py"], "/leagueofclass/cadastros/views.py": ["/leagueofclass/cadastros/models.py", "/leagueofclass/cadastros/form.py"]} |
42,874 | lipeacelino/Projeto-LOC | refs/heads/master | /leagueofclass/leagueofclass/urls.py |
"""leagueofclass URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | {"/leagueofclass/cadastros/form.py": ["/leagueofclass/cadastros/models.py"], "/leagueofclass/cadastros/views.py": ["/leagueofclass/cadastros/models.py", "/leagueofclass/cadastros/form.py"]} |
42,901 | westbaer/mexbtcapi | refs/heads/master | /mexbtcapi/concepts/market.py | from currency import ExchangeRate, Amount
from datetime import datetime, timedelta
from decimal import Decimal
class Trade(object):
"""Represents an exchange of two currency amounts.
May include the entities between which the trade is made
"""
def __init__(self, market, timestamp, from_amount, exchan... | {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,902 | westbaer/mexbtcapi | refs/heads/master | /mexbtcapi/api/bitfinex/rest/high_level.py | # -*- coding: utf-8 -*-
from decimal import Decimal
from functools import partial
from datetime import datetime,timedelta
import mexbtcapi
from mexbtcapi import concepts
from mexbtcapi.concepts.currencies import BTC, USD
from mexbtcapi.concepts.currency import Amount, ExchangeRate
from mexbtcapi.concepts.market impor... | {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,903 | westbaer/mexbtcapi | refs/heads/master | /demo/open_orders.py | import mexbtcapi
from mexbtcapi.concepts.currencies import USD
from mexbtcapi import api
market= mexbtcapi.api.mtgox.market(USD)
me= market.getParticipant(API_KEY,API_SECRET)
open_orders= me.getOpenOrders()
print open_orders
| {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,904 | westbaer/mexbtcapi | refs/heads/master | /mexbtcapi/__init__.py | from api import mtgox
from api import bitfinex
from api import bitstamp
import logging
logging.basicConfig()
logging.getLogger(__name__)
apis = [mtgox,
bitstamp,
bitfinex,
]
| {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,905 | westbaer/mexbtcapi | refs/heads/master | /mexbtcapi/concepts/currency.py | from decimal import Decimal
import logging
logger = logging.getLogger(__name__)
def check_number_for_decimal_conversion(number):
a = type(number) in (int, long)
b = isinstance(number, (str, unicode, Decimal))
if not (a or b):
logger.warning("You are using a number (" + str(number) +
... | {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,906 | westbaer/mexbtcapi | refs/heads/master | /mexbtcapi/concepts/numpy_conversions.py | import numpy as np
import time
from datetime import datetime
from decimal import Decimal
from mexbtcapi.concepts.market import Ticker
from mexbtcapi.concepts.currency import ExchangeRate
#this is the number that a Decimal will be multiplied by, in order to
#store it as a integer on numpy
DECIMAL_MULTIPLY= 1000000000... | {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,907 | westbaer/mexbtcapi | refs/heads/master | /demo/monitor_bitcoin_prices.py | '''This example gets the bitcoin ticker data of every available exchange
every 30 seconds and saves it immediatelly to disk, keeping a different
file for each hour'''
import time
import os
from functools import partial
from datetime import datetime
import numpy as np
import bisect
from multiprocessing.pool import T... | {"/mexbtcapi/api/bitfinex/rest/high_level.py": ["/mexbtcapi/__init__.py", "/mexbtcapi/concepts/currency.py", "/mexbtcapi/concepts/market.py"], "/mexbtcapi/concepts/numpy_conversions.py": ["/mexbtcapi/concepts/market.py", "/mexbtcapi/concepts/currency.py"]} |
42,913 | device42/splunk_to_device42 | refs/heads/master | /starter.py | #! /usr/bin/env python
import logging
import os
from files.main import get_config, Mapper, Splunker, Device42, DataParser
APP_DIR = os.path.abspath(os.path.dirname(__file__))
CONFIGFILE = os.path.join(APP_DIR, 'main.cfg')
APP_MAPPER = os.path.join(APP_DIR, 'app_mapper.cfg')
def your_code_goes_here():
"""... | {"/starter.py": ["/files/main.py", "/recipes/recipe_nix_add_on.py"]} |
42,914 | device42/splunk_to_device42 | refs/heads/master | /recipes/recipe_nix_add_on.py | #! /usr/bin/env python
import json
import splunklib.client as client
import splunklib.results as results
class Nix_Linux_add_on():
def __init__(self, host, port, username, password, timeframe, verbose):
self.host = host
self.port = port
self.user = username
self.p... | {"/starter.py": ["/files/main.py", "/recipes/recipe_nix_add_on.py"]} |
42,915 | device42/splunk_to_device42 | refs/heads/master | /files/util_uploader.py | # -*- coding: utf-8 -*-
import sys
import base64
import requests
try:
requests.packages.urllib3.disable_warnings()
except AttributeError:
pass
class Rest():
def __init__(self, BASE_URL, USERNAME, SECRET, DEBUG, VERBOSE, DRY_RUN, LOGGER):
self.base_url = BASE_URL
self.use... | {"/starter.py": ["/files/main.py", "/recipes/recipe_nix_add_on.py"]} |
42,916 | device42/splunk_to_device42 | refs/heads/master | /files/main.py | #! /usr/bin/env python
import ConfigParser
import os
import sys
import splunklib.client as client
import splunklib.results as results
from util_uploader import Rest
class Device42():
"""
Wrapper around util_uploader.py (code that actually uploads data to Device42).
"""
def __init__(self, url, user,... | {"/starter.py": ["/files/main.py", "/recipes/recipe_nix_add_on.py"]} |
42,924 | jramcast/mgr-service | refs/heads/master | /mgr/infrastructure/models/deep/feed_forward/__init__.py | from ..tensorflow import TensorFlowServingModelClient
class FeedForwardNetworkModel(TensorFlowServingModelClient):
"""
Client to consume the feed-forward network model
deployed with Tensorflow Serving
"""
pass
| {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,925 | jramcast/mgr-service | refs/heads/master | /mgr/domain/entities.py | import math
import os
from typing import List
from dataclasses import dataclass
@dataclass
class Prediction:
label: str
score: float
class ModelInputFeatures:
pass
@dataclass
class AudioSegment:
filename: str
start: float
stop: float
class AudioClip:
name: str
segments: List[Aud... | {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,926 | jramcast/mgr-service | refs/heads/master | /mgr/usecases/classify.py | from typing import List, Any, Dict
from .interfaces import Model, AudioLoader
from ..domain.entities import Prediction
class ClassifyUseCase:
models: List[Model]
def __init__(self, models: List[Model], audio_loader: AudioLoader):
self.models = models
self.audio_loader = audio_loader
de... | {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,927 | jramcast/mgr-service | refs/heads/master | /mgr/infrastructure/audioset/vggish/cache/memory.py | from mgr.usecases.interfaces import FeaturesCache
class InMemoryFeaturesCache(FeaturesCache):
def __init__(self):
self.storage = {}
def get(self, key: str):
return self.storage.get(key)
def set(self, key: str, entry):
self.storage[key] = entry
def __contains__(self, key: st... | {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,928 | jramcast/mgr-service | refs/heads/master | /scripts/test_proxy.py | from urllib import request
def download(url, retry_count=3, headers={}, proxy=None, data=None):
if url is None:
return None
try:
req = request.Request(url, headers=headers, data=data)
opener = request.build_opener()
if proxy:
proxies = {"https": proxy}
o... | {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,929 | jramcast/mgr-service | refs/heads/master | /tests/_utils.py | from unittest.mock import Mock
from asyncio import Future
def mock_resolves_to(value):
future = Future()
future.set_result(value)
return Mock(return_value=future)
| {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,930 | jramcast/mgr-service | refs/heads/master | /mgr/infrastructure/server/flask.py | import os
from flask import Flask
from flask_cors import CORS
class Server:
__slots__ = ["app", "route"]
def __init__(self):
self.app = Flask(
__name__,
static_folder=os.path.abspath("./static")
)
CORS(self.app)
self.route = self.app.route
@se... | {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
42,931 | jramcast/mgr-service | refs/heads/master | /mgr/infrastructure/models/deep/lstm/layers.py |
from keras.layers import (Activation, BatchNormalization, Dense, Dropout,
Input, LSTM)
from mgr.infrastructure.audioset.ontology import MUSIC_GENRE_CLASSES
num_units = 768
drop_rate = 0.5
def define_layers(inputs):
l1 = LSTM(1280, return_sequences=False)(inputs)
l1 = BatchNormaliz... | {"/mgr/infrastructure/models/deep/feed_forward/__init__.py": ["/mgr/infrastructure/models/deep/tensorflow.py"], "/mgr/usecases/classify.py": ["/mgr/usecases/interfaces.py", "/mgr/domain/entities.py"], "/mgr/infrastructure/audioset/vggish/cache/memory.py": ["/mgr/usecases/interfaces.py"], "/mgr/infrastructure/models/dee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.